diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-12-31 12:37:15 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-12-31 12:37:15 -0500 |
commit | 772804add8095eea9b3ec2a832c2f82fbb9a6fd5 (patch) | |
tree | 782a414d15f9091d04bcf3960a957f952958e548 /app/Template/board | |
parent | 66f150d887a34d2b51ff14f22d0fd41a34f8cc77 (diff) |
Acl refactoring
Diffstat (limited to 'app/Template/board')
-rw-r--r-- | app/Template/board/assignee.php | 2 | ||||
-rw-r--r-- | app/Template/board/category.php | 2 | ||||
-rw-r--r-- | app/Template/board/filters.php | 2 | ||||
-rw-r--r-- | app/Template/board/subtasks.php | 2 | ||||
-rw-r--r-- | app/Template/board/task.php | 20 |
5 files changed, 13 insertions, 15 deletions
diff --git a/app/Template/board/assignee.php b/app/Template/board/assignee.php index 1faf07f8..cd03a67e 100644 --- a/app/Template/board/assignee.php +++ b/app/Template/board/assignee.php @@ -1,7 +1,7 @@ <section id="main"> <section> <h3><?= t('Change assignee for the task "%s"', $values['title']) ?></h3> - <form method="post" action="<?= $this->u('board', 'updateAssignee', array('task_id' => $values['id'])) ?>"> + <form method="post" action="<?= $this->u('board', 'updateAssignee', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->formCsrf() ?> diff --git a/app/Template/board/category.php b/app/Template/board/category.php index 3fc77632..24842146 100644 --- a/app/Template/board/category.php +++ b/app/Template/board/category.php @@ -1,7 +1,7 @@ <section id="main"> <section> <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> - <form method="post" action="<?= $this->u('board', 'updateCategory', array('task_id' => $values['id'])) ?>"> + <form method="post" action="<?= $this->u('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->formCsrf() ?> diff --git a/app/Template/board/filters.php b/app/Template/board/filters.php index 1bce0029..e99fe234 100644 --- a/app/Template/board/filters.php +++ b/app/Template/board/filters.php @@ -27,7 +27,7 @@ <i class="fa fa-line-chart fa-fw"></i> <?= $this->a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->projectPermission->adminAllowed($project['id'], $this->acl->getUserId())): ?> + <?php if ($this->acl->isManagerActionAllowed($project['id'])): ?> <li><i class="fa fa-cog fa-fw"></i> <?= $this->a(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?> <?php endif ?> diff --git a/app/Template/board/subtasks.php b/app/Template/board/subtasks.php index 72e2b15c..1cb05498 100644 --- a/app/Template/board/subtasks.php +++ b/app/Template/board/subtasks.php @@ -4,7 +4,7 @@ trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['title']), 'board', 'toggleSubtask', - array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']) + array('task_id' => $subtask['task_id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']) ) ?> <?= $this->e(empty($subtask['username']) ? '' : ' ['.$this->getFullname($subtask).']') ?> diff --git a/app/Template/board/task.php b/app/Template/board/task.php index dca9a13a..78fabf70 100644 --- a/app/Template/board/task.php +++ b/app/Template/board/task.php @@ -1,5 +1,3 @@ - - <?php if ($not_editable): ?> <div class="task-board task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"> @@ -37,10 +35,10 @@ data-owner-id="<?= $task['owner_id'] ?>" data-category-id="<?= $task['category_id'] ?>" data-due-date="<?= $task['date_due'] ?>" - data-task-url="<?= $this->u('task', 'show', array('task_id' => $task['id'])) ?>" + data-task-url="<?= $this->u('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" title="<?= t('View this task') ?>"> - <?= $this->a('#'.$task['id'], 'task', 'edit', array('task_id' => $task['id']), false, 'task-edit-popover', t('Edit this task')) ?> + <?= $this->a('#'.$task['id'], 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-edit-popover', t('Edit this task')) ?> <?php if ($task['reference']): ?> <span class="task-board-reference" title="<?= t('Reference') ?>"> @@ -48,12 +46,12 @@ </span> <?php endif ?> - <span class="task-board-user <?= $this->acl->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>"> + <span class="task-board-user <?= $this->userSession->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>"> <?= $this->a( (! empty($task['owner_id']) ? t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), 'board', 'changeAssignee', - array('task_id' => $task['id']), + array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'assignee-popover', t('Change assignee') @@ -78,7 +76,7 @@ $this->inList($task['category_id'], $categories), 'board', 'changeCategory', - array('task_id' => $task['id']), + array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'category-popover', t('Change category') @@ -100,19 +98,19 @@ <div class="task-board-icons"> <?php if (! empty($task['nb_subtasks'])): ?> - <span title="<?= t('Sub-Tasks') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'subtasks', array('task_id' => $task['id'])) ?>"><?= $task['nb_completed_subtasks'].'/'.$task['nb_subtasks'] ?> <i class="fa fa-bars"></i></span> + <span title="<?= t('Sub-Tasks') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'subtasks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_completed_subtasks'].'/'.$task['nb_subtasks'] ?> <i class="fa fa-bars"></i></span> <?php endif ?> <?php if (! empty($task['nb_files'])): ?> - <span title="<?= t('Attachments') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'attachments', array('task_id' => $task['id'])) ?>"><?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i></span> + <span title="<?= t('Attachments') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'attachments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i></span> <?php endif ?> <?php if (! empty($task['nb_comments'])): ?> - <span title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'comments', array('task_id' => $task['id'])) ?>"><?= $task['nb_comments'] ?> <i class="fa fa-comment-o"></i></span> + <span title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'comments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_comments'] ?> <i class="fa fa-comment-o"></i></span> <?php endif ?> <?php if (! empty($task['description'])): ?> - <span title="<?= t('Description') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'description', array('task_id' => $task['id'])) ?>"> + <span title="<?= t('Description') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> <?php if (! isset($not_editable)): ?> <a class="task-description-popover" href="?controller=task&action=description&task_id=<?= $task['id'] ?>"><i class="fa fa-file-text-o" data-href="?controller=task&action=description&task_id=<?= $task['id'] ?>"></i></a> <?php else: ?> |