diff options
Diffstat (limited to 'app/Template')
43 files changed, 125 insertions, 111 deletions
diff --git a/app/Template/app/dashboard.php b/app/Template/app/dashboard.php index 5064967b..81305ed8 100644 --- a/app/Template/app/dashboard.php +++ b/app/Template/app/dashboard.php @@ -1,12 +1,12 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->acl->isAdminUser()): ?> + <?php if ($this->userSession->isAdmin()): ?> <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New project'), 'project', 'create') ?></li> <?php endif ?> <li><i class="fa fa-lock fa-fw"></i><?= $this->a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> <li><i class="fa fa-folder fa-fw"></i><?= $this->a(t('Project management'), 'project', 'index') ?></li> - <?php if ($this->acl->isAdminUser()): ?> + <?php if ($this->userSession->isAdmin()): ?> <li><i class="fa fa-user fa-fw"></i><?= $this->a(t('User management'), 'user', 'index') ?></li> <li><i class="fa fa-cog fa-fw"></i><?= $this->a(t('Settings'), 'config', 'index') ?></li> <?php endif ?> diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php index cb698c28..1a405210 100644 --- a/app/Template/app/projects.php +++ b/app/Template/app/projects.php @@ -14,7 +14,7 @@ <?= $this->a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> </td> <td> - <?php if ($this->projectPermission->adminAllowed($project['id'], $this->acl->getUserId())): ?> + <?php if ($this->projectPermission->isManager($project['id'], $this->userSession->getId())): ?> <?= $this->a('<i class="fa fa-cog"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?> <?php endif ?> <?= $this->a($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> 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: ?> diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 4110711e..1bdbac49 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -2,7 +2,7 @@ <h2><?= t('Add a comment') ?></h2> </div> -<form method="post" action="<?= $this->u('comment', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('task_id', $values) ?> <?= $this->formHidden('user_id', $values) ?> @@ -30,7 +30,7 @@ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?php if (! isset($skip_cancel)): ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php endif ?> </div> </form> diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index 51c3ced8..b4126a3e 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit a comment') ?></h2> </div> -<form method="post" action="<?= $this->u('comment', 'update', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('comment', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('id', $values) ?> @@ -30,6 +30,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </form> diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index 374d2c37..2338a03d 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -10,8 +10,8 @@ <?= $this->render('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?> <div class="form-actions"> - <?= $this->a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 2631975a..2cf9708b 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -9,12 +9,12 @@ <?php if (! isset($preview)): ?> <ul class="comment-actions"> <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li> - <?php if ((! isset($not_editable) || ! $not_editable) && ($this->acl->isAdminUser() || $this->acl->isCurrentUser($comment['user_id']))): ?> + <?php if ((! isset($not_editable) || ! $not_editable) && ($this->userSession->isAdmin() || $this->userSession->isCurrentUser($comment['user_id']))): ?> <li> - <?= $this->a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?> + <?= $this->a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> </li> <li> - <?= $this->a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?> + <?= $this->a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> </li> <?php endif ?> </ul> @@ -33,7 +33,16 @@ ) ) ?> <?php else: ?> - <?= $this->markdown($comment['comment']) ?> + <?= $this->markdown( + $comment['comment'], + array( + 'controller' => 'task', + 'action' => 'show', + 'params' => array( + 'project_id' => $project['id'] + ) + ) + ) ?> <?php endif ?> </div> diff --git a/app/Template/file/new.php b/app/Template/file/new.php index 861344b4..4f0c233b 100644 --- a/app/Template/file/new.php +++ b/app/Template/file/new.php @@ -2,13 +2,13 @@ <h2><?= t('Attach a document') ?></h2> </div> -<form action="<?= $this->u('file', 'save', array('task_id' => $task['id'])) ?>" method="post" enctype="multipart/form-data"> +<form action="<?= $this->u('file', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" enctype="multipart/form-data"> <?= $this->formCsrf() ?> <input type="file" name="files[]" multiple /> <div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->formatBytes($max_size) : $max_size ?></div> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/file/open.php b/app/Template/file/open.php index 9efd7780..70e0f8aa 100644 --- a/app/Template/file/open.php +++ b/app/Template/file/open.php @@ -1,6 +1,6 @@ <div class="page-header"> <h2><?= $this->e($file['name']) ?></h2> <div class="task-file-viewer"> - <img src="<?= $this->u('file', 'image', array('file_id' => $file['id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/> + <img src="<?= $this->u('file', 'image', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/> </div> </div>
\ No newline at end of file diff --git a/app/Template/file/remove.php b/app/Template/file/remove.php index 3e542c05..04ec30d5 100644 --- a/app/Template/file/remove.php +++ b/app/Template/file/remove.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/file/show.php b/app/Template/file/show.php index 4742db87..179f5744 100644 --- a/app/Template/file/show.php +++ b/app/Template/file/show.php @@ -8,12 +8,12 @@ <ul class="task-show-files"> <?php foreach ($files as $file): ?> <li> - <?= $this->a($this->e($file['name']), 'file', 'download', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?> + <?= $this->a($this->e($file['name']), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> <span class="task-show-file-actions"> <?php if ($file['is_image']): ?> - <?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'file_id' => $file['id']), false, 'file-popover') ?>, + <?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'file-popover') ?>, <?php endif ?> - <?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?> + <?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> </span> </li> <?php endforeach ?> diff --git a/app/Template/layout.php b/app/Template/layout.php index 3b642b48..9aa34905 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -44,7 +44,7 @@ <?php endif ?> <li> <?= $this->a(t('Logout'), 'user', 'logout', array(), true) ?> - <span class="username hide-tablet">(<?= $this->a($this->e($this->getFullname()), 'user', 'show', array('user_id' => $this->acl->getUserId())) ?>)</span> + <span class="username hide-tablet">(<?= $this->a($this->e($this->getFullname()), 'user', 'show', array('user_id' => $this->userSession->getId())) ?>)</span> </li> </ul> </nav> diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 4f07a83a..58c520d1 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,7 +1,7 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->acl->isAdminUser()): ?> + <?php if ($this->userSession->isAdmin()): ?> <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New project'), 'project', 'create') ?></li> <?php endif ?> <li><i class="fa fa-lock fa-fw"></i><?= $this->a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php index 0db9f3e8..ce154c19 100644 --- a/app/Template/project/layout.php +++ b/app/Template/project/layout.php @@ -7,7 +7,7 @@ </div> <section class="sidebar-container" id="project-section"> - <?= $this->render('project/sidebar', array('project' => $project, 'is_owner' => $is_owner)) ?> + <?= $this->render('project/sidebar', array('project' => $project)) ?> <div class="sidebar-content"> <?= $project_content_for_layout ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 52a971d6..f5d0e352 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -5,7 +5,7 @@ <?= $this->a(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->acl->isAdminUser() || $project['is_private']): ?> + <?php if ($this->acl->isManagerActionAllowed($project['id'])): ?> <li> <?= $this->a(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> </li> @@ -15,27 +15,23 @@ <li> <?= $this->a(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> </li> + <li> + <?= $this->a(t('Edit board'), 'board', 'edit', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= $this->a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= $this->a(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + </li> + <?php if ($project['is_private'] == 0): ?> + <li> + <?= $this->a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> + </li> <?php endif ?> - <?php if ($this->acl->isAdminUser() || $is_owner || $project['is_private']): ?> - <li> - <?= $this->a(t('Edit board'), 'board', 'edit', array('project_id' => $project['id'])) ?> - </li> - <li> - <?= $this->a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> - </li> - <li> - <?= $this->a(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> - </li> - <?php if ($project['is_private'] == 0): ?> - <li> - <?= $this->a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> - </li> - <?php endif ?> - <li> - <?= $this->a(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> - </li> - <?php endif ?> - <?php if ($this->acl->isAdminUser() || $project['is_private']): ?> + <li> + <?= $this->a(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> + </li> <li> <?= $this->a(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id']), true) ?> </li> @@ -46,13 +42,15 @@ <?= $this->a(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> <?php endif ?> </li> - <li> - <?= $this->a(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> - </li> + <?php if ($this->userSession->isAdmin()): ?> + <li> + <?= $this->a(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> + </li> + <?php endif ?> <?php endif ?> </ul> - <?php if ($this->acl->isAdminUser() || $project['is_private']): ?> + <?php if ($this->acl->isManagerActionAllowed($project['id'])): ?> <h2><?= t('Exports') ?></h2> <ul> <li> diff --git a/app/Template/project/users.php b/app/Template/project/users.php index da5da392..5dc4a7e5 100644 --- a/app/Template/project/users.php +++ b/app/Template/project/users.php @@ -18,15 +18,15 @@ <?php foreach ($users['allowed'] as $user_id => $username): ?> <tr> <td><?= $this->e($username) ?></td> - <td><?= isset($users['owners'][$user_id]) ? t('Project manager') : t('Project member') ?></td> + <td><?= isset($users['managers'][$user_id]) ? t('Project manager') : t('Project member') ?></td> <td> <ul> <li><?= $this->a(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?></li> <li> - <?php if (isset($users['owners'][$user_id])): ?> - <?= $this->a(t('Set project member'), 'project', 'setOwner', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> + <?php if (isset($users['managers'][$user_id])): ?> + <?= $this->a(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> <?php else: ?> - <?= $this->a(t('Set project manager'), 'project', 'setOwner', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> + <?= $this->a(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> <?php endif ?> </li> </ul> diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index ba550aea..73a08af1 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -2,7 +2,7 @@ <h2><?= t('Add a sub-task') ?></h2> </div> -<form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->formCsrf() ?> @@ -22,6 +22,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </form> diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index 76a04e45..4920eb32 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit a sub-task') ?></h2> </div> -<form method="post" action="<?= $this->u('subtask', 'update', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('subtask', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off"> <?= $this->formCsrf() ?> @@ -27,6 +27,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </form> diff --git a/app/Template/subtask/remove.php b/app/Template/subtask/remove.php index 3d57ec9d..af193c59 100644 --- a/app/Template/subtask/remove.php +++ b/app/Template/subtask/remove.php @@ -12,6 +12,6 @@ <div class="form-actions"> <?= $this->a(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/subtask/show.php b/app/Template/subtask/show.php index b453762c..c0f61f0e 100644 --- a/app/Template/subtask/show.php +++ b/app/Template/subtask/show.php @@ -21,7 +21,7 @@ <td> <?php if (! isset($not_editable)): ?> <?= $this->a(trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['status_name']), - 'subtask', 'toggleStatus', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> + 'subtask', 'toggleStatus', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> <?php else: ?> <?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['status_name']) ?> <?php endif ?> @@ -57,7 +57,7 @@ </table> <?php if (! isset($not_editable)): ?> - <form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off"> + <form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('task_id', array('task_id' => $task['id'])) ?> <?= $this->formText('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?> diff --git a/app/Template/task/close.php b/app/Template/task/close.php index 76852862..316d58eb 100644 --- a/app/Template/task/close.php +++ b/app/Template/task/close.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php index 6f380567..f81e0dc9 100644 --- a/app/Template/task/comments.php +++ b/app/Template/task/comments.php @@ -18,7 +18,7 @@ <?= $this->render('comment/create', array( 'skip_cancel' => true, 'values' => array( - 'user_id' => $this->acl->getUserId(), + 'user_id' => $this->userSession->getId(), 'task_id' => $task['id'], ), 'errors' => array(), diff --git a/app/Template/task/duplicate.php b/app/Template/task/duplicate.php index c1aed6be..cc7e0870 100644 --- a/app/Template/task/duplicate.php +++ b/app/Template/task/duplicate.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/duplicate_project.php b/app/Template/task/duplicate_project.php index d69da9d5..e227e046 100644 --- a/app/Template/task/duplicate_project.php +++ b/app/Template/task/duplicate_project.php @@ -17,7 +17,7 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </form> diff --git a/app/Template/task/edit.php b/app/Template/task/edit.php index ef1a9dfa..51cb2884 100644 --- a/app/Template/task/edit.php +++ b/app/Template/task/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit a task') ?></h2> </div> <section id="task-section"> -<form method="post" action="<?= $this->u('task', 'update', array('task_id' => $task['id'], 'ajax' => $ajax)) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('task', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off"> <?= $this->formCsrf() ?> @@ -61,7 +61,7 @@ <?php if ($ajax): ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> <?php else: ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php endif ?> </div> </form> diff --git a/app/Template/task/edit_description.php b/app/Template/task/edit_description.php index d53aff93..2af26ef4 100644 --- a/app/Template/task/edit_description.php +++ b/app/Template/task/edit_description.php @@ -2,7 +2,7 @@ <h2><?= t('Edit the description') ?></h2> </div> -<form method="post" action="<?= $this->u('task', 'description', array('task_id' => $task['id'], 'ajax' => $ajax)) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('id', $values) ?> @@ -32,7 +32,7 @@ <?php if ($ajax): ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> <?php else: ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php endif ?> </div> </form> diff --git a/app/Template/task/move_project.php b/app/Template/task/move_project.php index 15b295d7..ccc67851 100644 --- a/app/Template/task/move_project.php +++ b/app/Template/task/move_project.php @@ -17,7 +17,7 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </form> diff --git a/app/Template/task/open.php b/app/Template/task/open.php index 438acb34..1fcdcd80 100644 --- a/app/Template/task/open.php +++ b/app/Template/task/open.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/remove.php b/app/Template/task/remove.php index 59845c6a..c1eea5a0 100644 --- a/app/Template/task/remove.php +++ b/app/Template/task/remove.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/show.php b/app/Template/task/show.php index b98af52d..3bc6796f 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -1,5 +1,5 @@ <?= $this->render('task/details', array('task' => $task, 'project' => $project)) ?> -<?= $this->render('task/time', array('values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> +<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> <?= $this->render('task/show_description', array('task' => $task)) ?> <?= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks)) ?> <?= $this->render('task/timesheet', array('timesheet' => $timesheet)) ?> diff --git a/app/Template/task/show_description.php b/app/Template/task/show_description.php index 9cd278e3..3807ddd2 100644 --- a/app/Template/task/show_description.php +++ b/app/Template/task/show_description.php @@ -6,7 +6,16 @@ <article class="markdown task-show-description"> <?php if (! isset($is_public)): ?> - <?= $this->markdown($task['description']) ?> + <?= $this->markdown( + $task['description'], + array( + 'controller' => 'task', + 'action' => 'show', + 'params' => array( + 'project_id' => $task['project_id'] + ) + ) + ) ?> <?php else: ?> <?= $this->markdown( $task['description'], diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 1779255a..4ee7ca8a 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -2,22 +2,22 @@ <h2><?= t('Actions') ?></h2> <ul> <li> - <?= $this->a(t('Summary'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->a(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->a(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> <?= $this->a(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> @@ -30,14 +30,14 @@ </li> <li> <?php if ($task['is_active'] == 1): ?> - <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php else: ?> - <?= $this->a(t('Open this task'), 'task', 'open', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php endif ?> </li> <?php if (! $hide_remove_menu): ?> <li> - <?= $this->a(t('Remove'), 'task', 'remove', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php endif ?> </ul> diff --git a/app/Template/task/table.php b/app/Template/task/table.php index dfde4561..689cdcc4 100644 --- a/app/Template/task/table.php +++ b/app/Template/task/table.php @@ -13,7 +13,7 @@ <?php foreach ($tasks as $task): ?> <tr> <td class="task-table task-<?= $task['color_id'] ?>"> - <?= $this->a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> + <?= $this->a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </td> <td> <?= $this->inList($task['column_id'], $columns) ?> @@ -22,7 +22,7 @@ <?= $this->inList($task['category_id'], $categories, '') ?> </td> <td> - <?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> + <?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </td> <td> <?php if ($task['assignee_username']): ?> diff --git a/app/Template/task/time.php b/app/Template/task/time.php index b00cbc14..4aeddc70 100644 --- a/app/Template/task/time.php +++ b/app/Template/task/time.php @@ -1,4 +1,4 @@ -<form method="post" action="<?= $this->u('task', 'time', array('task_id' => $values['id'])) ?>" class="form-inline task-time-form" autocomplete="off"> +<form method="post" action="<?= $this->u('task', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('id', $values) ?> diff --git a/app/Template/user/edit.php b/app/Template/user/edit.php index 6766f952..68b264ec 100644 --- a/app/Template/user/edit.php +++ b/app/Template/user/edit.php @@ -20,7 +20,7 @@ <?= $this->formLabel(t('Default project'), 'default_project_id') ?> <?= $this->formSelect('default_project_id', $projects, $values, $errors) ?><br/> - <?php if ($this->acl->isAdminUser()): ?> + <?php if ($this->userSession->isAdmin()): ?> <?= $this->formCheckbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/> <?php endif ?> diff --git a/app/Template/user/external.php b/app/Template/user/external.php index 6ee1e459..b4cea156 100644 --- a/app/Template/user/external.php +++ b/app/Template/user/external.php @@ -6,7 +6,7 @@ <h3><i class="fa fa-google"></i> <?= t('Google Account') ?></h3> <p class="listing"> - <?php if ($this->acl->isCurrentUser($user['id'])): ?> + <?php if ($this->userSession->isCurrentUser($user['id'])): ?> <?php if (empty($user['google_id'])): ?> <?= $this->a(t('Link my Google Account'), 'user', 'google', array(), true) ?> <?php else: ?> @@ -22,7 +22,7 @@ <h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3> <p class="listing"> - <?php if ($this->acl->isCurrentUser($user['id'])): ?> + <?php if ($this->userSession->isCurrentUser($user['id'])): ?> <?php if (empty($user['github_id'])): ?> <?= $this->a(t('Link my GitHub Account'), 'user', 'github', array(), true) ?> <?php else: ?> diff --git a/app/Template/user/index.php b/app/Template/user/index.php index a6da9f65..e4729501 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -1,6 +1,6 @@ <section id="main"> <div class="page-header"> - <?php if ($this->acl->isAdminUser()): ?> + <?php if ($this->userSession->isAdmin()): ?> <ul> <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New user'), 'user', 'create') ?></li> </ul> diff --git a/app/Template/user/layout.php b/app/Template/user/layout.php index 94610000..a5a78a3f 100644 --- a/app/Template/user/layout.php +++ b/app/Template/user/layout.php @@ -1,6 +1,6 @@ <section id="main"> <div class="page-header"> - <?php if ($this->acl->isAdminUser()): ?> + <?php if ($this->userSession->isAdmin()): ?> <ul> <li><i class="fa fa-user fa-fw"></i><?= $this->a(t('All users'), 'user', 'index') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New user'), 'user', 'create') ?></li> diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index 5b7abc34..f74c8b01 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -5,7 +5,7 @@ <?= $this->a(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?> </li> - <?php if ($this->acl->isAdminUser() || $this->acl->isCurrentUser($user['id'])): ?> + <?php if ($this->userSession->isAdmin() || $this->userSession->isCurrentUser($user['id'])): ?> <li> <?= $this->a(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?> </li> @@ -30,7 +30,7 @@ </li> <?php endif ?> - <?php if ($this->acl->isAdminUser() && ! $this->acl->isCurrentUser($user['id'])): ?> + <?php if ($this->userSession->isAdmin() && ! $this->userSession->isCurrentUser($user['id'])): ?> <li> <?= $this->a(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?> </li> |