Acl refactoring
This commit is contained in:
@@ -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 ?>
|
||||
|
||||
@@ -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'])) ?>
|
||||
|
||||
@@ -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() ?>
|
||||
|
||||
|
||||
@@ -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() ?>
|
||||
|
||||
|
||||
@@ -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 ?>
|
||||
|
||||
@@ -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).']') ?>
|
||||
|
||||
@@ -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: ?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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 ?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 ?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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').'"')) ?>
|
||||
|
||||
@@ -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>
|
||||
@@ -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(),
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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)) ?>
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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']): ?>
|
||||
|
||||
@@ -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) ?>
|
||||
|
||||
|
||||
@@ -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 ?>
|
||||
|
||||
|
||||
@@ -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: ?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user