Creators should only edit/delete their own experiments
This commit is contained in:
@@ -8,22 +8,36 @@
|
|||||||
|
|
||||||
<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 (isset($job['id'])):
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
$disabled = ($job['started_at'] != '0000-00-00 00:00:00') ? true : false;
|
if (isset($job['id'])):
|
||||||
|
$disabled = ($job['started_at'] != '0000-00-00 00:00:00') ? true : false;
|
||||||
?>
|
?>
|
||||||
<a class="button disabled job_start"><?=_('Start job');?></a>
|
<a class="button disabled job_start"><?=_('Start job');?></a>
|
||||||
<?php
|
<?php
|
||||||
else:
|
else:
|
||||||
$disabled = false
|
$disabled = false
|
||||||
?>
|
?>
|
||||||
<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;
|
||||||
|
else:
|
||||||
|
$disabled = true;
|
||||||
endif;
|
endif;
|
||||||
if (!$disabled):
|
if (!$disabled):
|
||||||
?>
|
?>
|
||||||
@@ -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,17 +82,27 @@
|
|||||||
<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'])):
|
||||||
?>
|
?>
|
||||||
<span class="form_info">
|
<span class="form_info">
|
||||||
<a href="<?=site_url('ajax/parameter_help/' . $param['parameter_id']);?>" name="<?=_('Description');?>" id="<?=$param['parameter_id'];?>" class="jtip"> </a>
|
<a href="<?=site_url('ajax/parameter_help/' . $param['parameter_id']);?>" name="<?=_('Description');?>" id="<?=$param['parameter_id'];?>" class="jtip"> </a>
|
||||||
</span>
|
</span>
|
||||||
<?php
|
<?php
|
||||||
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>
|
||||||
@@ -83,14 +111,15 @@
|
|||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
if ($disabled):
|
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
|
||||||
|
if ($disabled):
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<a class="button save disabled"><?=_('Save changes');?></a>
|
<a class="button save disabled"><?=_('Save changes');?></a>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
else:
|
else:
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<strong><?=_('Note');?>:</strong> <?=_('The existing job will be deleted.');?>
|
<strong><?=_('Note');?>:</strong> <?=_('The existing job will be deleted.');?>
|
||||||
@@ -100,6 +129,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
endif;
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -72,13 +72,17 @@
|
|||||||
<?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
|
<?php
|
||||||
if ($job['css'] == 'closed' || $job['css'] == ''):
|
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>
|
| <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>
|
||||||
|
|||||||
Reference in New Issue
Block a user