summaryrefslogtreecommitdiff
path: root/app/Template/task/sidebar.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-17 20:36:18 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-17 20:36:18 -0400
commit4bc83646b0b15bff9ae55083121f66b7a89e433d (patch)
tree941a2710bc3e1926a5e8cdbdeaaa797612dfb819 /app/Template/task/sidebar.php
parent0e055eabe1a7d0e077105f6e9cc48057c9540443 (diff)
Add project restriction for opening/closing tasks
Diffstat (limited to 'app/Template/task/sidebar.php')
-rw-r--r--app/Template/task/sidebar.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php
index 827c2f39..87fe8cee 100644
--- a/app/Template/task/sidebar.php
+++ b/app/Template/task/sidebar.php
@@ -78,20 +78,22 @@
<i class="fa fa-clone fa-fw"></i>
<?= $this->url->link(t('Move to another project'), 'TaskDuplicationController', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
- <?php if ($task['is_active'] == 1): ?>
- <li>
- <i class="fa fa-arrows fa-fw"></i>
- <?= $this->url->link(t('Move position'), 'TaskMovePositionController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-times fa-fw"></i>
- <?= $this->url->link(t('Close this task'), 'TaskStatusController', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <?php else: ?>
- <li>
- <i class="fa fa-check-square-o fa-fw"></i>
- <?= $this->url->link(t('Open this task'), 'TaskStatusController', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
+ <?php if ($this->user->hasProjectAccess('TaskStatusController', 'close', $task['project_id'])): ?>
+ <?php if ($task['is_active'] == 1): ?>
+ <li>
+ <i class="fa fa-arrows fa-fw"></i>
+ <?= $this->url->link(t('Move position'), 'TaskMovePositionController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
+ </li>
+ <li>
+ <i class="fa fa-times fa-fw"></i>
+ <?= $this->url->link(t('Close this task'), 'TaskStatusController', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
+ </li>
+ <?php else: ?>
+ <li>
+ <i class="fa fa-check-square-o fa-fw"></i>
+ <?= $this->url->link(t('Open this task'), 'TaskStatusController', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
+ </li>
+ <?php endif ?>
<?php endif ?>
<?php if ($this->projectRole->canRemoveTask($task)): ?>
<li>