Restrict actions for project viewers

This commit is contained in:
Frederic Guillot
2015-12-06 17:39:21 -05:00
parent bd849ff655
commit f0651c48c1
13 changed files with 87 additions and 47 deletions

View File

@@ -1,4 +1,3 @@
<div id="subtasks" class="task-show-section">
<?php if (! empty($subtasks)): ?>
@@ -13,14 +12,14 @@
<th class="column-40"><?= t('Title') ?></th>
<th><?= t('Assignee') ?></th>
<th><?= t('Time tracking') ?></th>
<?php if (! isset($not_editable)): ?>
<?php if ($editable): ?>
<th><?= t('Actions') ?></th>
<?php endif ?>
</tr>
<?php foreach ($subtasks as $subtask): ?>
<tr>
<td>
<?php if (! isset($not_editable)): ?>
<?php if ($editable): ?>
<?= $this->subtask->toggleStatus($subtask, 'task') ?>
<?php else: ?>
<?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['title']) ?>
@@ -28,7 +27,7 @@
</td>
<td>
<?php if (! empty($subtask['username'])): ?>
<?php if (! isset($not_editable)): ?>
<?php if ($editable): ?>
<?= $this->url->link($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?>
<?php else: ?>
<?= $this->e($subtask['name'] ?: $subtask['username']) ?>
@@ -46,7 +45,7 @@
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
<?php if (! isset($not_editable) && $subtask['user_id'] == $this->user->getId()): ?>
<?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?>
<li>
<?php if ($subtask['is_timer_started']): ?>
<i class="fa fa-pause"></i>
@@ -60,7 +59,7 @@
<?php endif ?>
</ul>
</td>
<?php if (! isset($not_editable)): ?>
<?php if ($editable): ?>
<td>
<ul>
<?php if ($subtask['position'] != $first_position): ?>
@@ -87,7 +86,7 @@
</table>
<?php endif ?>
<?php if (! isset($not_editable) && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?>
<?php if ($editable && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?>
<?php if (empty($subtasks)): ?>
<div class="page-header">