diff --git a/app/Helper/Subtask.php b/app/Helper/Subtask.php
index 4bb26e777..7d474de02 100644
--- a/app/Helper/Subtask.php
+++ b/app/Helper/Subtask.php
@@ -14,12 +14,17 @@ class Subtask extends \Kanboard\Core\Base
* Get the link to toggle subtask status
*
* @access public
- * @param array $subtask
- * @param string $redirect
+ * @param array $subtask
+ * @param string $redirect
+ * @param integer $project_id
* @return string
*/
- public function toggleStatus(array $subtask, $redirect)
+ public function toggleStatus(array $subtask, $redirect, $project_id = 0)
{
+ if ($project_id > 0 && ! $this->helper->user->hasProjectAccess('subtask', 'edit', $project_id)) {
+ return trim($this->template->render('subtask/icons', array('subtask' => $subtask))) . $this->helper->e($subtask['title']);
+ }
+
if ($subtask['status'] == 0 && isset($this->sessionStorage->hasSubtaskInProgress) && $this->sessionStorage->hasSubtaskInProgress === true) {
return $this->helper->url->link(
trim($this->template->render('subtask/icons', array('subtask' => $subtask))) . $this->helper->e($subtask['title']),
diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php
index 8600d96e8..b9cdeb757 100644
--- a/app/ServiceProvider/AuthenticationProvider.php
+++ b/app/ServiceProvider/AuthenticationProvider.php
@@ -134,7 +134,7 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->add('Config', '*', Role::APP_ADMIN);
$acl->add('Currency', '*', Role::APP_ADMIN);
- $acl->add('Gantt', '*', Role::APP_MANAGER);
+ $acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER);
$acl->add('Group', '*', Role::APP_ADMIN);
$acl->add('Link', '*', Role::APP_ADMIN);
$acl->add('Project', array('users', 'allowEverybody', 'allow', 'role', 'revoke', 'create'), Role::APP_MANAGER);
diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php
index a5d05e497..ad09546eb 100644
--- a/app/Template/board/task_private.php
+++ b/app/Template/board/task_private.php
@@ -41,15 +41,19 @@
- = $this->url->link(
- $task['assignee_name'] ?: $task['assignee_username'],
- 'board',
- 'changeAssignee',
- array('task_id' => $task['id'], 'project_id' => $task['project_id']),
- false,
- 'popover',
- t('Change assignee')
- ) ?>
+ user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
+ = $this->url->link(
+ $task['assignee_name'] ?: $task['assignee_username'],
+ 'BoardPopover',
+ 'changeAssignee',
+ array('task_id' => $task['id'], 'project_id' => $task['project_id']),
+ false,
+ 'popover',
+ t('Change assignee')
+ ) ?>
+
+ = $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>
+
diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php
index 950da9256..5c273e080 100644
--- a/app/Template/board/tooltip_subtasks.php
+++ b/app/Template/board/tooltip_subtasks.php
@@ -1,6 +1,6 @@
= $this->e($file['name']) ?> '.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'
= $this->url->link(t('open file'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> - = $this->url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + user->hasProjectAccess('file', 'remove', $task['project_id'])): ?> + = $this->url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + = $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>'.t('size: %s', $this->text->bytes($file['size'])) ?>'> @@ -22,7 +20,9 @@
@@ -87,7 +86,7 @@ - user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?> + user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?>
diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php
index 070de3209..57fb305f2 100644
--- a/app/Template/task/comments.php
+++ b/app/Template/task/comments.php
@@ -15,12 +15,12 @@
'comment' => $comment,
'task' => $task,
'project' => $project,
- 'not_editable' => isset($not_editable) && $not_editable,
+ 'editable' => $editable,
'is_public' => isset($is_public) && $is_public,
)) ?>
-
+
= $this->render('comment/create', array(
'skip_cancel' => true,
'values' => array(
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index 9cd10dda4..74799b15e 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -86,7 +86,7 @@
-
+
-
= t('Recurring information') ?>
= $this->render('task/recurring_info', array(
diff --git a/app/Template/task/public.php b/app/Template/task/public.php
index e31054884..7edf097cc 100644
--- a/app/Template/task/public.php
+++ b/app/Template/task/public.php
@@ -1,33 +1,34 @@
- = $this->render('task/details', array('task' => $task, 'project' => $project, 'not_editable' => true)) ?>
+ = $this->render('task/details', array('task' => $task, 'project' => $project, 'editable' => false)) ?>
= t('Project') ?>
= t('Column') ?>
= t('Assignee') ?>
-
+
= t('Action') ?>
= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>
= $this->render('task/description', array( 'task' => $task, 'project' => $project, - 'is_public' => true + 'is_public' => true, )) ?> = $this->render('tasklink/show', array( 'task' => $task, 'links' => $links, 'project' => $project, - 'not_editable' => true + 'editable' => false, + 'is_public' => true, )) ?> = $this->render('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, - 'not_editable' => true + 'editable' => false )) ?> = $this->render('task/comments', array( 'task' => $task, 'comments' => $comments, 'project' => $project, - 'not_editable' => true, + 'editable' => false, 'is_public' => true, )) ?> diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 713c2b3a2..f6d47e53e 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -4,6 +4,7 @@ 'recurrence_trigger_list' => $this->task->recurrenceTriggers(), 'recurrence_timeframe_list' => $this->task->recurrenceTimeframes(), 'recurrence_basedate_list' => $this->task->recurrenceBasedates(), + 'editable' => $this->user->hasProjectAccess('taskmodification', 'edit', $project['id']), )) ?> user->hasProjectAccess('taskmodification', 'edit', $project['id'])): ?> @@ -11,8 +12,34 @@ = $this->render('task/description', array('task' => $task)) ?> -= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?> -= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks, 'project' => $project, 'users_list' => isset($users_list) ? $users_list : array())) ?> + += $this->render('tasklink/show', array( + 'task' => $task, + 'links' => $links, + 'link_label_list' => $link_label_list, + 'editable' => $this->user->hasProjectAccess('tasklink', 'edit', $project['id']), + 'is_public' => false, +)) ?> + += $this->render('subtask/show', array( + 'task' => $task, + 'subtasks' => $subtasks, + 'project' => $project, + 'users_list' => isset($users_list) ? $users_list : array(), + 'editable' => $this->user->hasProjectAccess('subtask', 'edit', $project['id']), +)) ?> + = $this->render('task/time_tracking_summary', array('task' => $task)) ?> -= $this->render('file/show', array('task' => $task, 'files' => $files, 'images' => $images)) ?> -= $this->render('task/comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?> + += $this->render('file/show', array( + 'task' => $task, + 'files' => $files, + 'images' => $images +)) ?> + += $this->render('task/comments', array( + 'task' => $task, + 'comments' => $comments, + 'project' => $project, + 'editable' => $this->user->hasProjectAccess('comment', 'edit', $project['id']), +)) ?> diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php index b66ec0875..fbb1f825a 100644 --- a/app/Template/tasklink/show.php +++ b/app/Template/tasklink/show.php @@ -9,7 +9,7 @@