diff options
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/board/edit.php | 2 | ||||
-rw-r--r-- | app/Template/board/index.php | 18 | ||||
-rw-r--r-- | app/Template/board/public.php | 43 | ||||
-rw-r--r-- | app/Template/board/show.php | 73 | ||||
-rw-r--r-- | app/Template/board/swimlane.php | 59 | ||||
-rw-r--r-- | app/Template/board/task.php | 16 | ||||
-rw-r--r-- | app/Template/category/index.php | 7 | ||||
-rw-r--r-- | app/Template/project/sidebar.php | 3 | ||||
-rw-r--r-- | app/Template/project/users.php | 4 | ||||
-rw-r--r-- | app/Template/swimlane/edit.php | 18 | ||||
-rw-r--r-- | app/Template/swimlane/index.php | 47 | ||||
-rw-r--r-- | app/Template/swimlane/remove.php | 17 | ||||
-rw-r--r-- | app/Template/swimlane/table.php | 44 | ||||
-rw-r--r-- | app/Template/task/new.php | 1 |
14 files changed, 251 insertions, 101 deletions
diff --git a/app/Template/board/edit.php b/app/Template/board/edit.php index d7086504..a44abcc8 100644 --- a/app/Template/board/edit.php +++ b/app/Template/board/edit.php @@ -16,7 +16,7 @@ </tr> <?php foreach ($columns as $column): ?> <tr> - <td><?= Helper\form_label(++$i, 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td> + <td><?= Helper\form_label('#'.++$i, 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td> <td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td> <td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td> <td> diff --git a/app/Template/board/index.php b/app/Template/board/index.php index 21040373..53c662a0 100644 --- a/app/Template/board/index.php +++ b/app/Template/board/index.php @@ -6,16 +6,12 @@ 'project' => $project, )) ?> - <?php if (empty($board)): ?> - <p class="alert alert-error"><?= t('There is no column in your project!') ?></p> - <?php else: ?> - <?= Helper\template('board/show', array( - 'project' => $project, - 'board' => $board, - 'categories' => $categories, - 'board_private_refresh_interval' => $board_private_refresh_interval, - 'board_highlight_period' => $board_highlight_period, - )) ?> - <?php endif ?> + <?= Helper\template('board/show', array( + 'project' => $project, + 'swimlanes' => $swimlanes, + 'categories' => $categories, + 'board_private_refresh_interval' => $board_private_refresh_interval, + 'board_highlight_period' => $board_highlight_period, + )) ?> </section> diff --git a/app/Template/board/public.php b/app/Template/board/public.php index 090d617b..0544f392 100644 --- a/app/Template/board/public.php +++ b/app/Template/board/public.php @@ -1,39 +1,12 @@ <section id="main" class="public-board"> - <?php if (empty($columns)): ?> - <p class="alert alert-error"><?= t('There is no column in your project!') ?></p> - <?php else: ?> - <table id="board"> - <tr> - <?php $column_with = round(100 / count($columns), 2); ?> - <?php foreach ($columns as $column): ?> - <th width="<?= $column_with ?>%"> - <?= Helper\escape($column['title']) ?> - <?php if ($column['task_limit']): ?> - <span title="<?= t('Task limit') ?>" class="task-limit">(<?= Helper\escape(count($column['tasks']).'/'.$column['task_limit']) ?>)</span> - <?php endif ?> - </th> - <?php endforeach ?> - </tr> - <tr> - <?php foreach ($columns as $column): ?> - <td class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>"> - <?php foreach ($column['tasks'] as $task): ?> - <div class="task-board task-<?= $task['color_id'] ?>"> - - <?= Helper\template('board/task', array( - 'task' => $task, - 'categories' => $categories, - 'not_editable' => true, - 'project' => $project - )) ?> - - </div> - <?php endforeach ?> - </td> - <?php endforeach ?> - </tr> - </table> - <?php endif ?> + <?= Helper\template('board/show', array( + 'project' => $project, + 'swimlanes' => $swimlanes, + 'categories' => $categories, + 'board_private_refresh_interval' => $board_private_refresh_interval, + 'board_highlight_period' => $board_highlight_period, + 'not_editable' => true, + )) ?> </section>
\ No newline at end of file diff --git a/app/Template/board/show.php b/app/Template/board/show.php index 142969c9..7df19bc1 100644 --- a/app/Template/board/show.php +++ b/app/Template/board/show.php @@ -1,51 +1,28 @@ -<table id="board" - data-project-id="<?= $project['id'] ?>" - data-check-interval="<?= $board_private_refresh_interval ?>" - data-save-url="<?= Helper\u('board', 'save', array('project_id' => $project['id'])) ?>" - data-check-url="<?= Helper\u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" -> -<tr> - <?php $column_with = round(100 / count($board), 2); ?> - <?php foreach ($board as $column): ?> - <th width="<?= $column_with ?>%"> - <div class="board-add-icon"> - <?= Helper\a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id']), false, 'task-creation-popover', t('Add a new task')) ?> - </div> - <?= Helper\escape($column['title']) ?> - <?php if ($column['task_limit']): ?> - <span title="<?= t('Task limit') ?>" class="task-limit"> - (<span id="task-number-column-<?= $column['id'] ?>"><?= count($column['tasks']) ?></span>/<?= Helper\escape($column['task_limit']) ?>) - </span> - <?php else: ?> - <span title="<?= t('Task count') ?>" class="task-count"> - (<span id="task-number-column-<?= $column['id'] ?>"><?= count($column['tasks']) ?></span>) - </span> - <?php endif ?> - </th> - <?php endforeach ?> -</tr> -<tr> - <?php foreach ($board as $column): ?> - <td - id="column-<?= $column['id'] ?>" - class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>" - data-column-id="<?= $column['id'] ?>" - data-task-limit="<?= $column['task_limit'] ?>" - > - <?php foreach ($column['tasks'] as $task): ?> - <div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>" - data-task-id="<?= $task['id'] ?>" - data-owner-id="<?= $task['owner_id'] ?>" - data-category-id="<?= $task['category_id'] ?>" - data-due-date="<?= $task['date_due'] ?>" - data-task-url="<?= Helper\u('task', 'show', array('task_id' => $task['id'])) ?>" - title="<?= t('View this task') ?>"> - <?= Helper\template('board/task', array('task' => $task, 'categories' => $categories)) ?> +<?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="<?= Helper\u('board', 'save', array('project_id' => $project['id'])) ?>" + data-check-url="<?= Helper\u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" + > +<?php endif ?> - </div> - <?php endforeach ?> - </td> - <?php endforeach ?> -</tr> +<?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: ?> + <?= Helper\template('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> diff --git a/app/Template/board/swimlane.php b/app/Template/board/swimlane.php new file mode 100644 index 00000000..e48eb6f1 --- /dev/null +++ b/app/Template/board/swimlane.php @@ -0,0 +1,59 @@ +<tr> + <?php if (! $hide_swimlane): ?> + <td width="10%"></td> + <?php endif ?> + + <?php foreach ($swimlane['columns'] as $column): ?> + <th> + <?php if (! $not_editable): ?> + <div class="board-add-icon"> + <?= Helper\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')) ?> + </div> + <?php endif ?> + + <?= Helper\escape($column['title']) ?> + + <?php if ($column['task_limit']): ?> + <span title="<?= t('Task limit') ?>" class="task-limit"> + (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= Helper\escape($column['task_limit']) ?>) + </span> + <?php else: ?> + <span title="<?= t('Task count') ?>" class="task-count"> + (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>) + </span> + <?php endif ?> + </th> + <?php endforeach ?> +</tr> +<tr> + <?php if (! $hide_swimlane): ?> + <th class="board-swimlane-title"> + <?= Helper\escape($swimlane['name']) ?> + </th> + <?php endif ?> + + <?php foreach ($swimlane['columns'] as $column): ?> + + <?php if ($not_editable): ?> + <td> + <?php else: ?> + <td + id="column-<?= $column['id'] ?>" + class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>" + data-column-id="<?= $column['id'] ?>" + data-swimlane-id="<?= $swimlane['id'] ?>" + data-task-limit="<?= $column['task_limit'] ?>"> + <?php endif ?> + + <?php foreach ($column['tasks'] as $task): ?> + <?= Helper\template('board/task', array( + 'project' => $project, + 'task' => $task, + 'categories' => $categories, + 'board_highlight_period' => $board_highlight_period, + 'not_editable' => $not_editable, + )) ?> + <?php endforeach ?> + </td> + <?php endforeach ?> +</tr>
\ No newline at end of file diff --git a/app/Template/board/task.php b/app/Template/board/task.php index 64448acc..d077c773 100644 --- a/app/Template/board/task.php +++ b/app/Template/board/task.php @@ -1,4 +1,8 @@ -<?php if (isset($not_editable)): ?> + + +<?php if ($not_editable): ?> + +<div class="task-board task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"> <?= Helper\a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> @@ -28,6 +32,14 @@ <?php else: ?> +<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>" + data-task-id="<?= $task['id'] ?>" + data-owner-id="<?= $task['owner_id'] ?>" + data-category-id="<?= $task['category_id'] ?>" + data-due-date="<?= $task['date_due'] ?>" + data-task-url="<?= Helper\u('task', 'show', array('task_id' => $task['id'])) ?>" + title="<?= t('View this task') ?>"> + <?= Helper\a('#'.$task['id'], 'task', 'edit', array('task_id' => $task['id']), false, 'task-edit-popover', t('Edit this task')) ?> <?php if ($task['reference']): ?> @@ -114,3 +126,5 @@ </div> </div> <?php endif ?> + +</div>
\ No newline at end of file diff --git a/app/Template/category/index.php b/app/Template/category/index.php index 8a3eb4f1..bd275a67 100644 --- a/app/Template/category/index.php +++ b/app/Template/category/index.php @@ -1,8 +1,7 @@ +<?php if (! empty($categories)): ?> <div class="page-header"> <h2><?= t('Categories') ?></h2> </div> - -<?php if (! empty($categories)): ?> <table> <tr> <th><?= t('Category Name') ?></th> @@ -26,7 +25,9 @@ </table> <?php endif ?> -<h3><?= t('Add a new category') ?></h3> +<div class="page-header"> + <h2><?= t('Add a new category') ?></h2> +</div> <form method="post" action="<?= Helper\u('category', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= Helper\form_csrf() ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index dc9a811b..5107451a 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -20,6 +20,9 @@ <li> <?= Helper\a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> </li> + <li> + <?= Helper\a(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + </li> <?php if ($project['is_private'] == 0): ?> <li> <?= Helper\a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project/users.php b/app/Template/project/users.php index 3a59df7a..691fe9fd 100644 --- a/app/Template/project/users.php +++ b/app/Template/project/users.php @@ -19,9 +19,9 @@ if ($is_owner): ?> [owner] <?php endif ?> <?php if ($project['is_private'] == 0): ?> <?php if ($is_owner): ?> - (<a href=<?= Helper\u('project', 'setOwner', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> ><?= t('make user') ?></a> + (<a href=<?= Helper\u('project', 'setOwner', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> ><?= t('set user') ?></a> <?php else: ?> - (<a href=<?= Helper\u('project', 'setOwner', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> ><?= t('make owner') ?></a> + (<a href=<?= Helper\u('project', 'setOwner', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> ><?= t('set manager') ?></a> <?php endif ?> or <?= Helper\a(t('revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?>) diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php new file mode 100644 index 00000000..fca555f7 --- /dev/null +++ b/app/Template/swimlane/edit.php @@ -0,0 +1,18 @@ +<div class="page-header"> + <h2><?= t('Swimlane modification for the project "%s"', $project['name']) ?></h2> +</div> + +<form method="post" action="<?= Helper\u('swimlane', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off"> + + <?= Helper\form_csrf() ?> + + <?= Helper\form_hidden('id', $values) ?> + <?= Helper\form_hidden('project_id', $values) ?> + + <?= Helper\form_label(t('Name'), 'name') ?> + <?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php new file mode 100644 index 00000000..ec822c15 --- /dev/null +++ b/app/Template/swimlane/index.php @@ -0,0 +1,47 @@ +<?php if (! empty($active_swimlanes)): ?> +<div class="page-header"> + <h2><?= t('Active swimlanes') ?></h2> +</div> +<?= Helper\template('swimlane/table', array('swimlanes' => $active_swimlanes, 'project' => $project)) ?> +<?php endif ?> + +<div class="page-header"> + <h2><?= t('Add a new swimlane') ?></h2> +</div> +<form method="post" action="<?= Helper\u('swimlane', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + + <?= Helper\form_csrf() ?> + <?= Helper\form_hidden('project_id', $values) ?> + + <?= Helper\form_label(t('Name'), 'name') ?> + <?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> + +<div class="page-header"> + <h2><?= t('Change default swimlane') ?></h2> +</div> +<form method="post" action="<?= Helper\u('swimlane', 'change', array('project_id' => $project['id'])) ?>" autocomplete="off"> + + <?= Helper\form_csrf() ?> + <?= Helper\form_hidden('id', $default_swimlane) ?> + + <?= Helper\form_label(t('Rename'), 'default_swimlane') ?> + <?= Helper\form_text('default_swimlane', $default_swimlane, array(), array('autofocus required')) ?><br/> + + <?= Helper\form_checkbox('show_default_swimlane', t('Show default swimlane'), 1, isset($default_swimlane['show_default_swimlane']) && $default_swimlane['show_default_swimlane'] == 1) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> + +<?php if (! empty($inactive_swimlanes)): ?> +<div class="page-header"> + <h2><?= t('Inactive swimlanes') ?></h2> +</div> +<?= Helper\template('swimlane/table', array('swimlanes' => $inactive_swimlanes, 'project' => $project, 'hide_position' => true)) ?> +<?php endif ?>
\ No newline at end of file diff --git a/app/Template/swimlane/remove.php b/app/Template/swimlane/remove.php new file mode 100644 index 00000000..edf8803c --- /dev/null +++ b/app/Template/swimlane/remove.php @@ -0,0 +1,17 @@ +<section id="main"> + <div class="page-header"> + <h2><?= t('Remove a swimlane') ?></h2> + </div> + + <div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this swimlane: "%s"?', $swimlane['name']) ?> + </p> + + <div class="form-actions"> + <?= Helper\a(t('Yes'), 'swimlane', 'remove', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + </div> + </div> +</section>
\ No newline at end of file diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php new file mode 100644 index 00000000..ac7ed835 --- /dev/null +++ b/app/Template/swimlane/table.php @@ -0,0 +1,44 @@ +<table> + <tr> + <?php if (! isset($hide_position)): ?> + <th><?= t('Position') ?></th> + <?php endif ?> + <th class="column-70"><?= t('Name') ?></th> + <th><?= t('Actions') ?></th> + </tr> + <?php foreach ($swimlanes as $swimlane): ?> + <tr> + <?php if (! isset($hide_position)): ?> + <td>#<?= $swimlane['position'] ?></td> + <?php endif ?> + <td><?= Helper\escape($swimlane['name']) ?></td> + <td> + <ul> + <?php if ($swimlane['position'] != 0 && $swimlane['position'] != 1): ?> + <li> + <?= Helper\a(t('Move Up'), 'swimlane', 'moveup', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + </li> + <?php endif ?> + <?php if ($swimlane['position'] != 0 && $swimlane['position'] != count($swimlanes)): ?> + <li> + <?= Helper\a(t('Move Down'), 'swimlane', 'movedown', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + </li> + <?php endif ?> + <li> + <?= Helper\a(t('Rename'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> + </li> + <li> + <?php if ($swimlane['is_active']): ?> + <?= Helper\a(t('Disable'), 'swimlane', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + <?php else: ?> + <?= Helper\a(t('Enable'), 'swimlane', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + <?php endif ?> + </li> + <li> + <?= Helper\a(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> + </li> + </ul> + </td> + </tr> + <?php endforeach ?> +</table>
\ No newline at end of file diff --git a/app/Template/task/new.php b/app/Template/task/new.php index 72e7d25b..3e2576c5 100644 --- a/app/Template/task/new.php +++ b/app/Template/task/new.php @@ -47,6 +47,7 @@ <div class="form-column"> <?= Helper\form_hidden('project_id', $values) ?> + <?= Helper\form_hidden('swimlane_id', $values) ?> <?= Helper\form_label(t('Assignee'), 'owner_id') ?> <?= Helper\form_select('owner_id', $users_list, $values, $errors) ?><br/> |