Creators should only edit/delete their own experiments
This commit is contained in:
@@ -8,12 +8,23 @@
|
||||
|
||||
<div class="box">
|
||||
<h3><?=_('Description');?></h3>
|
||||
<?php
|
||||
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||
?>
|
||||
<div class="editInPlace"><?=auto_typography($experiment['description']);?></div>
|
||||
<p></p>
|
||||
<?php
|
||||
else:
|
||||
?>
|
||||
<?=auto_typography($experiment['description']);?>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
<h3>Actions</h3>
|
||||
<p>
|
||||
<?php
|
||||
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||
if (isset($job['id'])):
|
||||
$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>
|
||||
<?php
|
||||
endif;
|
||||
else:
|
||||
$disabled = true;
|
||||
endif;
|
||||
if (!$disabled):
|
||||
?>
|
||||
<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>
|
||||
<?php
|
||||
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>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<?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']);?>">
|
||||
<?php
|
||||
@@ -64,6 +82,9 @@
|
||||
<tr>
|
||||
<td width="40%"><?=$param['readable'];?></td>
|
||||
<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"' : '';?> />
|
||||
<?php
|
||||
if (!empty($param['description'])):
|
||||
@@ -75,6 +96,13 @@
|
||||
endif;
|
||||
?>
|
||||
<?=form_error('params');?>
|
||||
<?php
|
||||
else:
|
||||
?>
|
||||
<?=($param['value']) ? $param['value'] : '-';?>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<td><?=$param['unit'];?></td>
|
||||
</tr>
|
||||
@@ -84,6 +112,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||
if ($disabled):
|
||||
?>
|
||||
<p>
|
||||
@@ -101,6 +130,7 @@
|
||||
</form>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -72,14 +72,18 @@
|
||||
<?php
|
||||
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/edit/' . $experiment['id']);?>" title="<?=sprintf(_('Edit this experiment'), $experiment['name']);?>"><?=_('Edit');?></a>
|
||||
<a href="<?=site_url('experiments/create/' . $project['id'] . '/' . $experiment['id']);?>" title="<?=sprintf(_('Copy experiment "%s"'), $experiment['name']);?>"><?=_('Copy');?></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
|
||||
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>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user