From 6efac784fcc1a2e83bb7b43fc7841448b5975cba Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 24 Jun 2015 20:39:06 -0400 Subject: Add timer for subtasks and remove settings for subtask time tracking --- app/Controller/Timer.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/Controller/Timer.php (limited to 'app/Controller/Timer.php') diff --git a/app/Controller/Timer.php b/app/Controller/Timer.php new file mode 100644 index 00000000..2a4531ba --- /dev/null +++ b/app/Controller/Timer.php @@ -0,0 +1,35 @@ +request->getIntegerParam('project_id'); + $task_id = $this->request->getIntegerParam('task_id'); + $subtask_id = $this->request->getIntegerParam('subtask_id'); + $timer = $this->request->getStringParam('timer'); + + if ($timer === 'start') { + $this->subtaskTimeTracking->logStartTime($subtask_id, $this->userSession->getId()); + } + else if ($timer === 'stop') { + $this->subtaskTimeTracking->logEndTime($subtask_id, $this->userSession->getId()); + $this->subtaskTimeTracking->updateTaskTimeTracking($task_id); + } + + $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $project_id, 'task_id' => $task_id)).'#subtasks'); + } +} -- cgit v1.2.3