diff options
Diffstat (limited to 'app/Template/board')
-rw-r--r-- | app/Template/board/filters.php | 13 | ||||
-rw-r--r-- | app/Template/board/show.php | 54 | ||||
-rw-r--r-- | app/Template/board/swimlane.php | 14 | ||||
-rw-r--r-- | app/Template/board/task.php | 161 | ||||
-rw-r--r-- | app/Template/board/task_footer.php | 45 | ||||
-rw-r--r-- | app/Template/board/task_public.php | 30 | ||||
-rw-r--r-- | app/Template/board/tasklinks.php | 15 |
7 files changed, 182 insertions, 150 deletions
diff --git a/app/Template/board/filters.php b/app/Template/board/filters.php index 0e9c4d5f..64a01b8f 100644 --- a/app/Template/board/filters.php +++ b/app/Template/board/filters.php @@ -6,6 +6,14 @@ <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a> <ul> <li> + <span class="filter-collapse"> + <i class="fa fa-compress fa-fw"></i> <a href="#" class="filter-collapse-link"><?= t('Collapse tasks') ?></a> + </span> + <span class="filter-expand" style="display: none"> + <i class="fa fa-expand fa-fw"></i> <a href="#" class="filter-expand-link"><?= t('Expand tasks') ?></a> + </span> + </li> + <li> <i class="fa fa-search fa-fw"></i> <?= $this->a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> </li> @@ -21,6 +29,11 @@ <i class="fa fa-calendar fa-fw"></i> <?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> </li> + <?php if ($project['is_public']): ?> + <li> + <i class="fa fa-share-alt fa-fw"></i> <?= $this->a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?> + </li> + <?php endif ?> <?php if ($this->acl->isManagerActionAllowed($project['id'])): ?> <li> <i class="fa fa-line-chart fa-fw"></i> diff --git a/app/Template/board/show.php b/app/Template/board/show.php index 5fbb576c..f1607d26 100644 --- a/app/Template/board/show.php +++ b/app/Template/board/show.php @@ -1,28 +1,30 @@ - -<?php if (isset($not_editable)): ?> - <table id="board"> -<?php else: ?> - <table id="board" - data-project-id="<?= $project['id'] ?>" - data-check-interval="<?= $board_private_refresh_interval ?>" - data-save-url="<?= $this->u('board', 'save', array('project_id' => $project['id'])) ?>" - data-check-url="<?= $this->u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" - > -<?php endif ?> - -<?php foreach ($swimlanes as $swimlane): ?> - <?php if (empty($swimlane['columns'])): ?> - <p class="alert alert-error"><?= t('There is no column in your project!') ?></p> - <?php break ?> +<div id="board-container"> + <?php if (isset($not_editable)): ?> + <table id="board"> <?php else: ?> - <?= $this->render('board/swimlane', array( - 'project' => $project, - 'swimlane' => $swimlane, - 'board_highlight_period' => $board_highlight_period, - 'categories' => $categories, - 'hide_swimlane' => count($swimlanes) === 1, - 'not_editable' => isset($not_editable), - )) ?> + <table id="board" + data-project-id="<?= $project['id'] ?>" + data-check-interval="<?= $board_private_refresh_interval ?>" + data-save-url="<?= $this->u('board', 'save', array('project_id' => $project['id'])) ?>" + data-check-url="<?= $this->u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" + data-task-creation-url="<?= $this->u('task', 'create', array('project_id' => $project['id'])) ?>" + > <?php endif ?> -<?php endforeach ?> -</table> + + <?php foreach ($swimlanes as $swimlane): ?> + <?php if (empty($swimlane['columns'])): ?> + <p class="alert alert-error"><?= t('There is no column in your project!') ?></p> + <?php break ?> + <?php else: ?> + <?= $this->render('board/swimlane', array( + 'project' => $project, + 'swimlane' => $swimlane, + 'board_highlight_period' => $board_highlight_period, + 'categories' => $categories, + 'hide_swimlane' => count($swimlanes) === 1, + 'not_editable' => isset($not_editable), + )) ?> + <?php endif ?> + <?php endforeach ?> + </table> +</div>
\ No newline at end of file diff --git a/app/Template/board/swimlane.php b/app/Template/board/swimlane.php index f0a00fc1..08efdd11 100644 --- a/app/Template/board/swimlane.php +++ b/app/Template/board/swimlane.php @@ -2,7 +2,7 @@ <?php if (! $hide_swimlane): ?> <th> - <?php if ($swimlane['nb_tasks'] > 0): ?> + <?php if (! $not_editable && $swimlane['nb_tasks'] > 0): ?> <a href="#" class="board-swimlane-toggle" data-swimlane-id="<?= $swimlane['id'] ?>"> <i class="fa fa-minus-circle hide-icon-swimlane-<?= $swimlane['id'] ?>"></i> <i class="fa fa-plus-circle show-icon-swimlane-<?= $swimlane['id'] ?>" style="display: none"></i> @@ -18,21 +18,21 @@ <?php endif ?> <?php foreach ($swimlane['columns'] as $column): ?> - <th> + <th class="board-column"> <?php if (! $not_editable): ?> <div class="board-add-icon"> - <?= $this->a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-creation-popover', t('Add a new task')) ?> + <?= $this->a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?> </div> <?php endif ?> <?= $this->e($column['title']) ?> - + <?php if (! empty($column['description'])): ?> - <span class="column-tooltip pull-right" title="<?= $this->markdown($column['description']) ?>"> + <span class="column-tooltip pull-right" title="<?= $this->markdown($column['description']) ?>"> <i class="fa fa-info-circle"></i> </span> <?php endif ?> - + <?php if ($column['task_limit']): ?> <span title="<?= t('Task limit') ?>" class="task-limit"> (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->e($column['task_limit']) ?>) @@ -65,7 +65,7 @@ <?php endif ?> <?php foreach ($column['tasks'] as $task): ?> - <?= $this->render('board/task', array( + <?= $this->render($not_editable ? 'board/task_public' : 'board/task', array( 'project' => $project, 'task' => $task, 'categories' => $categories, diff --git a/app/Template/board/task.php b/app/Template/board/task.php index 5cad4004..a2a617a6 100644 --- a/app/Template/board/task.php +++ b/app/Template/board/task.php @@ -1,35 +1,3 @@ -<?php if ($not_editable): ?> - -<div class="task-board color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"> - - <?= $this->a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> - - <?php if ($task['reference']): ?> - <span class="task-board-reference" title="<?= t('Reference') ?>"> - (<?= $task['reference'] ?>) - </span> - <?php endif ?> - - - - - <span class="task-board-user"> - <?php if (! empty($task['owner_id'])): ?> - <?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?> - <?php else: ?> - <span class="task-board-nobody"><?= t('Nobody assigned') ?></span> - <?php endif ?> - </span> - - <?php if ($task['score']): ?> - <span class="task-score"><?= $this->e($task['score']) ?></span> - <?php endif ?> - - <div class="task-board-title"> - <?= $this->a($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> - </div> - -<?php else: ?> - <div class="task-board draggable-item color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>" data-task-id="<?= $task['id'] ?>" data-owner-id="<?= $task['owner_id'] ?>" @@ -38,98 +6,57 @@ data-task-url="<?= $this->u('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" title="<?= t('View this task') ?>"> - <ul class="dropdown"> - <li> - <a href="#" class="dropdown-menu"><?= '#'.$task['id'] ?></a> - <ul> - <li><i class="fa fa-user"></i> <?= $this->a(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'assignee-popover') ?></li> - <li><i class="fa fa-tag"></i> <?= $this->a(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'category-popover') ?></li> - <li><i class="fa fa-align-left"></i> <?= $this->a(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-description-popover') ?></li> - <li><i class="fa fa-pencil-square-o"></i> <?= $this->a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-edit-popover') ?></li> - <li><i class="fa fa-close"></i> <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => 'board'), true) ?></li> - </li> - </li> - </ul> - - <?php if ($task['reference']): ?> - <span class="task-board-reference" title="<?= t('Reference') ?>"> - (<?= $task['reference'] ?>) - </span> - <?php endif ?> - - <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'], 'project_id' => $task['project_id']), - false, - 'assignee-popover', - t('Change assignee') - ) ?> - </span> - - <span title="<?= t('Task age in days')?>" class="task-days-age"><?= t('%dd', floor(time()/86400) - floor($task['date_creation']/86400)) ?></span> - <span title="<?= t('Days in this column')?>" class="task-days-incolumn"><?= t('%dd', floor(time()/86400) - floor($task['date_moved']/86400)) ?></span> - - <?php if ($task['score']): ?> - <span class="task-score"><?= $this->e($task['score']) ?></span> - <?php endif ?> - - <div class="task-board-title"> - <?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + <div class="task-board-collapsed" style="display: none"> + <?= $this->a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-id') ?> + <?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title') ?> </div> -<?php endif ?> - - -<?php if ($task['category_id']): ?> -<div class="task-board-category-container"> - <span class="task-board-category"> - <?= $this->a( - $this->inList($task['category_id'], $categories), - 'board', - 'changeCategory', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), - false, - 'category-popover', - t('Change category') - ) ?> - </span> -</div> -<?php endif ?> - - -<?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description']) || ! empty($task['nb_subtasks'])): ?> -<div class="task-board-footer"> - - <?php if (! empty($task['date_due'])): ?> - <div class="task-board-date <?= time() > $task['date_due'] ? 'task-board-date-overdue' : '' ?>"> - <i class="fa fa-calendar"></i> <?= dt('%b %e, %Y', $task['date_due']) ?> - </div> - <?php endif ?> - - <div class="task-board-icons"> + <div class="task-board-expanded"> + + <ul class="dropdown"> + <li> + <a href="#" class="dropdown-menu"><?= '#'.$task['id'] ?></a> + <ul> + <li><i class="fa fa-user"></i> <?= $this->a(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li> + <li><i class="fa fa-tag"></i> <?= $this->a(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li> + <li><i class="fa fa-align-left"></i> <?= $this->a(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li> + <li><i class="fa fa-pencil-square-o"></i> <?= $this->a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li> + <li><i class="fa fa-close"></i> <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?></li> + </ul> + </li> + </ul> - <?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'], 'project_id' => $task['project_id'])) ?>"><?= round($task['nb_completed_subtasks']/$task['nb_subtasks']*100, 0).'%' ?> <i class="fa fa-bars"></i></span> + <?php if ($task['reference']): ?> + <span class="task-board-reference" title="<?= t('Reference') ?>"> + (<?= $task['reference'] ?>) + </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'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i></span> + <span class="task-board-user <?= $this->userSession->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>"> + <?= $this->a( + (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), + 'board', + 'changeAssignee', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + false, + 'task-board-popover', + t('Change assignee') + ) ?> + </span> + + <?php if ($task['score']): ?> + <span class="task-score"><?= $this->e($task['score']) ?></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'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_comments'] ?> <i class="fa fa-comment-o"></i></span> - <?php endif ?> + <div class="task-board-days"> + <span title="<?= t('Task age in days')?>" class="task-days-age"><?= $this->getTaskAge($task['date_creation']) ?></span> + <span title="<?= t('Days in this column')?>" class="task-days-incolumn"><?= $this->getTaskAge($task['date_moved']) ?></span> + </div> - <?php if (! empty($task['description'])): ?> - <span title="<?= t('Description') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> - <i class="fa fa-file-text-o"></i> - </span> - <?php endif ?> + <div class="task-board-title"> + <?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + </div> + + <?= $this->render('board/task_footer', array('task' => $task, 'categories' => $categories)) ?> </div> </div> -<?php endif ?> - -</div>
\ No newline at end of file diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php new file mode 100644 index 00000000..d413692c --- /dev/null +++ b/app/Template/board/task_footer.php @@ -0,0 +1,45 @@ +<?php if ($task['category_id']): ?> +<div class="task-board-category-container"> + <span class="task-board-category"> + <?= $this->a( + $this->inList($task['category_id'], $categories), + 'board', + 'changeCategory', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + false, + 'task-board-popover', + t('Change category') + ) ?> + </span> +</div> +<?php endif ?> + +<div class="task-board-icons"> + <?php if (! empty($task['date_due'])): ?> + <span class="task-board-date <?= time() > $task['date_due'] ? 'task-board-date-overdue' : '' ?>"> + <i class="fa fa-calendar"></i> <?= dt('%b %e', $task['date_due']) ?> + </span> + <?php endif ?> + + <?php if (! empty($task['nb_links'])): ?> + <span title="<?= t('Links') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'tasklinks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_links'] ?> <i class="fa fa-code-fork"></i></span> + <?php endif ?> + + <?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'], 'project_id' => $task['project_id'])) ?>"><?= round($task['nb_completed_subtasks']/$task['nb_subtasks']*100, 0).'%' ?> <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'], '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'], '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'], 'project_id' => $task['project_id'])) ?>"> + <i class="fa fa-file-text-o"></i> + </span> + <?php endif ?> +</div>
\ No newline at end of file diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php new file mode 100644 index 00000000..650b956d --- /dev/null +++ b/app/Template/board/task_public.php @@ -0,0 +1,30 @@ +<div class="task-board color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"> + + <?= $this->a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> + + <?php if ($task['reference']): ?> + <span class="task-board-reference" title="<?= t('Reference') ?>"> + (<?= $task['reference'] ?>) + </span> + <?php endif ?> + + - + + <span class="task-board-user"> + <?php if (! empty($task['owner_id'])): ?> + <?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?> + <?php else: ?> + <span class="task-board-nobody"><?= t('Nobody assigned') ?></span> + <?php endif ?> + </span> + + <?php if ($task['score']): ?> + <span class="task-score"><?= $this->e($task['score']) ?></span> + <?php endif ?> + + <div class="task-board-title"> + <?= $this->a($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> + </div> + + <?= $this->render('board/task_footer', array('task' => $task, 'categories' => $categories)) ?> +</div>
\ No newline at end of file diff --git a/app/Template/board/tasklinks.php b/app/Template/board/tasklinks.php new file mode 100644 index 00000000..9c4f52ca --- /dev/null +++ b/app/Template/board/tasklinks.php @@ -0,0 +1,15 @@ +<div class="tooltip-tasklinks"> + <ul> + <?php foreach($links as $link): ?> + <li> + <strong><?= t($link['label']) ?></strong> + <?= $this->a( + $this->e('#'.$link['task_id'].' - '.$link['title']), + 'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), + false, + $link['is_active'] ? '' : 'task-link-closed' + ) ?> + </li> + <?php endforeach ?> + </ul> +</div>
\ No newline at end of file |