From 4807f3e8a0ac2cca2706fb8215b762541982c682 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 7 Jul 2015 19:29:39 -0400 Subject: Add icon to set automatically the start date --- app/Controller/Task.php | 12 ++++++++++++ app/Template/task/time.php | 5 +++++ 2 files changed, 17 insertions(+) (limited to 'app') diff --git a/app/Controller/Task.php b/app/Controller/Task.php index bb859679..162b0ddd 100644 --- a/app/Controller/Task.php +++ b/app/Controller/Task.php @@ -619,4 +619,16 @@ class Task extends Base 'transitions' => $this->transition->getAllByTask($task['id']), ))); } + + /** + * Set automatically the start date + * + * @access public + */ + public function start() + { + $task = $this->getTask(); + $this->taskModification->update(array('id' => $task['id'], 'date_started' => time())); + $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']))); + } } diff --git a/app/Template/task/time.php b/app/Template/task/time.php index 9e024c7f..90407d7a 100644 --- a/app/Template/task/time.php +++ b/app/Template/task/time.php @@ -1,4 +1,9 @@
+ + + url->link('', 'task', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-show-start-link', t('Set automatically the start date')) ?> + + form->csrf() ?> form->hidden('id', $values) ?> -- cgit v1.2.3