Creators should only edit/delete their own experiments
This commit is contained in:
@@ -8,12 +8,23 @@
|
|||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3><?=_('Description');?></h3>
|
<h3><?=_('Description');?></h3>
|
||||||
|
<?php
|
||||||
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
|
?>
|
||||||
<div class="editInPlace"><?=auto_typography($experiment['description']);?></div>
|
<div class="editInPlace"><?=auto_typography($experiment['description']);?></div>
|
||||||
<p></p>
|
<p></p>
|
||||||
|
<?php
|
||||||
|
else:
|
||||||
|
?>
|
||||||
|
<?=auto_typography($experiment['description']);?>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
|
||||||
<h3>Actions</h3>
|
<h3>Actions</h3>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
if (isset($job['id'])):
|
if (isset($job['id'])):
|
||||||
$disabled = ($job['started_at'] != '0000-00-00 00:00:00') ? true : false;
|
$disabled = ($job['started_at'] != '0000-00-00 00:00:00') ? true : false;
|
||||||
?>
|
?>
|
||||||
@@ -25,6 +36,9 @@
|
|||||||
<a href="<?=site_url('jobs/start/' . $experiment['id']);?>" class="button job_start"><?=_('Start job');?></a>
|
<a href="<?=site_url('jobs/start/' . $experiment['id']);?>" class="button job_start"><?=_('Start job');?></a>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
else:
|
||||||
|
$disabled = true;
|
||||||
|
endif;
|
||||||
if (!$disabled):
|
if (!$disabled):
|
||||||
?>
|
?>
|
||||||
<a href="<?=site_url('experiments/copy/' . $experiment['id']);?>" class="button left copy"><?=_('Copy experiment');?>
|
<a href="<?=site_url('experiments/copy/' . $experiment['id']);?>" class="button left copy"><?=_('Copy experiment');?>
|
||||||
@@ -35,14 +49,18 @@
|
|||||||
<a href="<?=site_url('experiments/copy/' . $experiment['id']);?>" class="button copy"><?=_('Copy experiment');?></a>
|
<a href="<?=site_url('experiments/copy/' . $experiment['id']);?>" class="button copy"><?=_('Copy experiment');?></a>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
?>
|
?>
|
||||||
<a href="javascript:changeTitle('<?=$experiment['name'];?>', '<?=site_url('ajax/rename_experiment/' . $experiment['id']);?>');" class="button experiment_rename"><?=_('Change title');?></a>
|
<a href="javascript:changeTitle('<?=$experiment['name'];?>', '<?=site_url('ajax/rename_experiment/' . $experiment['id']);?>');" class="button experiment_rename"><?=_('Change title');?></a>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<?php
|
<?php
|
||||||
if (!$disabled):
|
if (!$disabled && ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin())):
|
||||||
?>
|
?>
|
||||||
<form name="editExperiment" method="post" action="<?=site_url('experiments/detail/' . $experiment['id']);?>">
|
<form name="editExperiment" method="post" action="<?=site_url('experiments/detail/' . $experiment['id']);?>">
|
||||||
<?php
|
<?php
|
||||||
@@ -64,6 +82,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td width="40%"><?=$param['readable'];?></td>
|
<td width="40%"><?=$param['readable'];?></td>
|
||||||
<td width="41%">
|
<td width="41%">
|
||||||
|
<?php
|
||||||
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
|
?>
|
||||||
<input type="text" name="param-<?=$param['parameter_id'];?>" class="long text" value="<?=(!empty($_POST['param-' . $param['parameter_id']]) ? $this->input->post('param-' . $param['parameter_id']) : $param['value']);?>"<?=($disabled) ? ' disabled="disabled"' : '';?> />
|
<input type="text" name="param-<?=$param['parameter_id'];?>" class="long text" value="<?=(!empty($_POST['param-' . $param['parameter_id']]) ? $this->input->post('param-' . $param['parameter_id']) : $param['value']);?>"<?=($disabled) ? ' disabled="disabled"' : '';?> />
|
||||||
<?php
|
<?php
|
||||||
if (!empty($param['description'])):
|
if (!empty($param['description'])):
|
||||||
@@ -75,6 +96,13 @@
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<?=form_error('params');?>
|
<?=form_error('params');?>
|
||||||
|
<?php
|
||||||
|
else:
|
||||||
|
?>
|
||||||
|
<?=($param['value']) ? $param['value'] : '-';?>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td><?=$param['unit'];?></td>
|
<td><?=$param['unit'];?></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -84,6 +112,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
if ($disabled):
|
if ($disabled):
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
@@ -101,6 +130,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
endif;
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -72,14 +72,18 @@
|
|||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<a href="<?=site_url('experiments/create/' . $project['id'] . '/' . $experiment['id']);?>" title="<?=sprintf(_('Copy experiment "%s"'), $experiment['name']);?>"><?=_('Copy');?></a> |
|
<a href="<?=site_url('experiments/create/' . $project['id'] . '/' . $experiment['id']);?>" title="<?=sprintf(_('Copy experiment "%s"'), $experiment['name']);?>"><?=_('Copy');?></a>
|
||||||
<a href="<?=site_url('experiments/edit/' . $experiment['id']);?>" title="<?=sprintf(_('Edit this experiment'), $experiment['name']);?>"><?=_('Edit');?></a>
|
<?php
|
||||||
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
|
?>
|
||||||
|
| <a href="<?=site_url('experiments/edit/' . $experiment['id']);?>" title="<?=sprintf(_('Edit this experiment'), $experiment['name']);?>"><?=_('Edit');?></a>
|
||||||
<?php
|
<?php
|
||||||
if ($job['css'] == 'closed' || $job['css'] == ''):
|
if ($job['css'] == 'closed' || $job['css'] == ''):
|
||||||
?>
|
?>
|
||||||
| <a href="javascript:deleteConfirm('<?=site_url('experiments/delete/' . $experiment['id']);?>');" title="<?=sprintf(_('Delete this experiment'), $experiment['name']);?>"><?=_('Delete');?></a>
|
| <a href="javascript:deleteConfirm('<?=site_url('experiments/delete/' . $experiment['id']);?>');" title="<?=sprintf(_('Delete this experiment'), $experiment['name']);?>"><?=_('Delete');?></a>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
endif;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user