From f3deb6492a74f1ffa9e3391274e0ab7947a04016 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 26 Feb 2017 19:30:02 -0500 Subject: Add toggle button to show/hide subtasks in task list view --- app/Template/subtask/table.php | 24 ++++++------------------ app/Template/subtask/timer.php | 13 +++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 app/Template/subtask/timer.php (limited to 'app/Template/subtask') diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index bfb42e75..5488796d 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -21,9 +21,9 @@ 'task' => $task, 'subtask' => $subtask, )) ?> - subtask->toggleStatus($subtask, $task['project_id'], true) ?> + subtask->renderToggleStatus($task, $subtask, true) ?> - subtask->getTitle($subtask) ?> + subtask->renderTitle($subtask) ?> @@ -33,22 +33,10 @@ hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?> - - text->e($subtask['time_spent']).'h' ?> - - - - text->e($subtask['time_estimated']).'h' ?> - - - user->getId()): ?> - - url->icon('pause', t('Stop timer'), 'SubtaskStatusController', 'timer', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?> - (dt->age($subtask['timer_start_date']) ?>) - - url->icon('play-circle-o', t('Start timer'), 'SubtaskStatusController', 'timer', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?> - - + render('subtask/timer', array( + 'task' => $task, + 'subtask' => $subtask, + )) ?> diff --git a/app/Template/subtask/timer.php b/app/Template/subtask/timer.php new file mode 100644 index 00000000..2102e6cc --- /dev/null +++ b/app/Template/subtask/timer.php @@ -0,0 +1,13 @@ + + + text->e($subtask['time_spent']).'h' ?> + + + + text->e($subtask['time_estimated']).'h' ?> + + + user->hasProjectAccess('SubtaskController', 'edit', $task['project_id']) && $subtask['user_id'] == $this->user->getId()): ?> + subtask->renderTimer($task, $subtask) ?> + + -- cgit v1.2.3