summaryrefslogtreecommitdiff
path: root/app/Model/SubtaskTimeTracking.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/SubtaskTimeTracking.php')
-rw-r--r--app/Model/SubtaskTimeTracking.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php
index 1e7e252e..8b197c46 100644
--- a/app/Model/SubtaskTimeTracking.php
+++ b/app/Model/SubtaskTimeTracking.php
@@ -307,17 +307,13 @@ class SubtaskTimeTracking extends Base
->eq('end', 0)
->findOneColumn('start');
- $time_spent = $this->db
- ->table(Subtask::TABLE)
- ->eq('id', $subtask_id)
- ->findOneColumn('time_spent');
+ $subtask = $this->subtask->getById($subtask_id);
return $start_time &&
- $this->db
- ->table(Subtask::TABLE)
- ->eq('id', $subtask_id)
- ->update(array(
- 'time_spent' => $time_spent + round((time() - $start_time) / 3600, 1)
- ));
+ $this->subtask->update(array( // Fire the event subtask.update
+ 'id' => $subtask['id'],
+ 'time_spent' => $subtask['time_spent'] + round((time() - $start_time) / 3600, 1),
+ 'task_id' => $subtask['task_id'],
+ ));
}
}