diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-10-11 21:11:10 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-10-11 21:11:10 -0400 |
commit | acba6839a6082e3e3800a733f8baea7c843fc02e (patch) | |
tree | e2847dcd13d9ccc3d8f0f6f936a5776df852e11b /app/Templates | |
parent | a8418afdebe92dde495bc5010645779c73939b7b (diff) |
Add 3 new fields for tasks: start date, time estimated and time spent
Diffstat (limited to 'app/Templates')
-rw-r--r-- | app/Templates/file_show.php | 38 | ||||
-rw-r--r-- | app/Templates/subtask_create.php | 2 | ||||
-rw-r--r-- | app/Templates/subtask_edit.php | 4 | ||||
-rw-r--r-- | app/Templates/subtask_show.php | 22 | ||||
-rw-r--r-- | app/Templates/task_details.php | 15 | ||||
-rw-r--r-- | app/Templates/task_new.php | 3 | ||||
-rw-r--r-- | app/Templates/task_public.php | 2 | ||||
-rw-r--r-- | app/Templates/task_show.php | 15 | ||||
-rw-r--r-- | app/Templates/task_time.php | 15 | ||||
-rw-r--r-- | app/Templates/task_timesheet.php | 13 |
10 files changed, 77 insertions, 52 deletions
diff --git a/app/Templates/file_show.php b/app/Templates/file_show.php index b570de2d..3832a0f5 100644 --- a/app/Templates/file_show.php +++ b/app/Templates/file_show.php @@ -1,17 +1,23 @@ -<div class="page-header"> - <h2><?= t('Attachments') ?></h2> -</div> +<?php if (! empty($files)): ?> +<div id="attachments" class="task-show-section"> + + <div class="page-header"> + <h2><?= t('Attachments') ?></h2> + </div> -<ul class="task-show-files"> -<?php foreach ($files as $file): ?> - <li> - <a href="?controller=file&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a> - <span class="task-show-file-actions"> - <?php if ($file['is_image']): ?> - <a href="?controller=file&action=open&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="file-popover"><?= t('open') ?></a>, - <?php endif ?> - <a href="?controller=file&action=confirm&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a> - </span> - </li> -<?php endforeach ?> -</ul>
\ No newline at end of file + <ul class="task-show-files"> + <?php foreach ($files as $file): ?> + <li> + <a href="?controller=file&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a> + <span class="task-show-file-actions"> + <?php if ($file['is_image']): ?> + <a href="?controller=file&action=open&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="file-popover"><?= t('open') ?></a>, + <?php endif ?> + <a href="?controller=file&action=confirm&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a> + </span> + </li> + <?php endforeach ?> + </ul> + +</div> +<?php endif ?>
\ No newline at end of file diff --git a/app/Templates/subtask_create.php b/app/Templates/subtask_create.php index f1b27ab9..c8ee556b 100644 --- a/app/Templates/subtask_create.php +++ b/app/Templates/subtask_create.php @@ -14,7 +14,7 @@ <?= Helper\form_label(t('Assignee'), 'user_id') ?> <?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Original Estimate'), 'time_estimated') ?> + <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> <?= Helper\form_checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> diff --git a/app/Templates/subtask_edit.php b/app/Templates/subtask_edit.php index fc65d3b3..91690d0a 100644 --- a/app/Templates/subtask_edit.php +++ b/app/Templates/subtask_edit.php @@ -18,10 +18,10 @@ <?= Helper\form_label(t('Assignee'), 'user_id') ?> <?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Original Estimate'), 'time_estimated') ?> + <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> - <?= Helper\form_label(t('Time Spent'), 'time_spent') ?> + <?= Helper\form_label(t('Time spent'), 'time_spent') ?> <?= Helper\form_numeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/> <div class="form-actions"> diff --git a/app/Templates/subtask_show.php b/app/Templates/subtask_show.php index 112262bd..f1b0466f 100644 --- a/app/Templates/subtask_show.php +++ b/app/Templates/subtask_show.php @@ -5,14 +5,6 @@ <h2><?= t('Sub-Tasks') ?></h2> </div> - <?php - - $total_spent = 0; - $total_estimated = 0; - $total_remaining = 0; - - ?> - <table class="subtasks-table"> <tr> <th width="40%"><?= t('Title') ?></th> @@ -64,11 +56,6 @@ </td> <?php endif ?> </tr> - <?php - $total_estimated += $subtask['time_estimated']; - $total_spent += $subtask['time_spent']; - $total_remaining = $total_estimated - $total_spent; - ?> <?php endforeach ?> </table> @@ -81,14 +68,5 @@ </form> <?php endif ?> - <div class="subtasks-time-tracking"> - <h4><?= t('Time tracking') ?></h4> - <ul> - <li><?= t('Estimate:') ?> <strong><?= Helper\escape($total_estimated) ?></strong> <?= t('hours') ?></li> - <li><?= t('Spent:') ?> <strong><?= Helper\escape($total_spent) ?></strong> <?= t('hours') ?></li> - <li><?= t('Remaining:') ?> <strong><?= Helper\escape($total_remaining > 0 ? $total_remaining : 0) ?></strong> <?= t('hours') ?></li> - </ul> - </div> - </div> <?php endif ?> diff --git a/app/Templates/task_details.php b/app/Templates/task_details.php index 8766beac..a4fdf6ce 100644 --- a/app/Templates/task_details.php +++ b/app/Templates/task_details.php @@ -22,11 +22,26 @@ <?= dt('Completed on %B %e, %Y at %k:%M %p', $task['date_completed']) ?> </li> <?php endif ?> + <?php if ($task['date_started']): ?> + <li> + <?= dt('Started on %B %e, %Y', $task['date_started']) ?> + </li> + <?php endif ?> <?php if ($task['date_due']): ?> <li> <strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong> </li> <?php endif ?> + <?php if ($task['time_estimated']): ?> + <li> + <?= t('Estimated time: %s hours', $task['time_estimated']) ?> + </li> + <?php endif ?> + <?php if ($task['time_spent']): ?> + <li> + <?= t('Time spent: %s hours', $task['time_spent']) ?> + </li> + <?php endif ?> <?php if ($task['creator_username']): ?> <li> <?= t('Created by %s', $task['creator_name'] ?: $task['creator_username']) ?> diff --git a/app/Templates/task_new.php b/app/Templates/task_new.php index 867bcbc9..51142165 100644 --- a/app/Templates/task_new.php +++ b/app/Templates/task_new.php @@ -38,6 +38,9 @@ <?= Helper\form_label(t('Complexity'), 'score') ?> <?= Helper\form_number('score', $values, $errors) ?><br/> + <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> + <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> + <?= Helper\form_label(t('Due Date'), 'date_due') ?> <?= Helper\form_text('date_due', $values, $errors, array('placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?><br/> <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> diff --git a/app/Templates/task_public.php b/app/Templates/task_public.php index 4578b720..bc4608d1 100644 --- a/app/Templates/task_public.php +++ b/app/Templates/task_public.php @@ -2,6 +2,8 @@ <?= Helper\template('task_details', array('task' => $task, 'project' => $project)) ?> + <p class="align-right"><?= Helper\a(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p> + <?= Helper\template('task_show_description', array('task' => $task)) ?> <?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks, 'not_editable' => true)) ?> diff --git a/app/Templates/task_show.php b/app/Templates/task_show.php index ece4c57c..0964a8f0 100644 --- a/app/Templates/task_show.php +++ b/app/Templates/task_show.php @@ -1,14 +1,7 @@ - <?= Helper\template('task_details', array('task' => $task, 'project' => $project)) ?> - +<?= Helper\template('task_time', array('values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> <?= Helper\template('task_show_description', array('task' => $task)) ?> - <?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?> - -<?php if (! empty($files)): ?> -<div id="attachments" class="task-show-section"> - <?= Helper\template('file_show', array('task' => $task, 'files' => $files)) ?> -</div> -<?php endif ?> - -<?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments)) ?> +<?= Helper\template('task_timesheet', array('timesheet' => $timesheet)) ?> +<?= Helper\template('file_show', array('task' => $task, 'files' => $files)) ?> +<?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments)) ?>
\ No newline at end of file diff --git a/app/Templates/task_time.php b/app/Templates/task_time.php new file mode 100644 index 00000000..11a76303 --- /dev/null +++ b/app/Templates/task_time.php @@ -0,0 +1,15 @@ +<form method="post" action="<?= Helper\u('task', 'time', array('task_id' => $values['id'])) ?>" class="form-inline task-time-form" autocomplete="off"> + <?= Helper\form_csrf() ?> + <?= Helper\form_hidden('id', $values) ?> + + <?= Helper\form_label(t('Start date'), 'date_started') ?> + <?= Helper\form_text('date_started', $values, array(), array('placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?> + + <?= Helper\form_label(t('Time estimated'), 'time_estimated') ?> + <?= Helper\form_numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> + + <?= Helper\form_label(t('Time spent'), 'time_spent') ?> + <?= Helper\form_numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?> + + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> +</form>
\ No newline at end of file diff --git a/app/Templates/task_timesheet.php b/app/Templates/task_timesheet.php new file mode 100644 index 00000000..cd093657 --- /dev/null +++ b/app/Templates/task_timesheet.php @@ -0,0 +1,13 @@ +<?php if ($timesheet['time_estimated'] > 0 || $timesheet['time_spent'] > 0): ?> + +<div class="page-header"> + <h2><?= t('Time tracking') ?></h2> +</div> + +<ul class="listing"> + <li><?= t('Estimate:') ?> <strong><?= Helper\escape($timesheet['time_estimated']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Spent:') ?> <strong><?= Helper\escape($timesheet['time_spent']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Remaining:') ?> <strong><?= Helper\escape($timesheet['time_remaining']) ?></strong> <?= t('hours') ?></li> +</ul> + +<?php endif ?>
\ No newline at end of file |