summaryrefslogtreecommitdiff
path: root/app/Model/SubtaskTimeTracking.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-14 22:10:08 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-14 22:10:08 -0400
commitd1e6c39df4e6cb9eec60bf498e0d1c7abb23ace8 (patch)
treed1bd7422b364be088722a464317fffe5f97fd37c /app/Model/SubtaskTimeTracking.php
parenteaff957839ad2cfaf3b5913f99dd56ca85c7c1e1 (diff)
Fix issue: task time tracking is not updated when deleting a subtask
Diffstat (limited to 'app/Model/SubtaskTimeTracking.php')
-rw-r--r--app/Model/SubtaskTimeTracking.php19
1 files changed, 3 insertions, 16 deletions
diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php
index 997031e8..56998769 100644
--- a/app/Model/SubtaskTimeTracking.php
+++ b/app/Model/SubtaskTimeTracking.php
@@ -339,20 +339,7 @@ class SubtaskTimeTracking extends Base
*/
public function updateTaskTimeTracking($task_id)
{
- $result = $this->calculateSubtaskTime($task_id);
- $values = array();
-
- if ($result['total_spent'] > 0) {
- $values['time_spent'] = $result['total_spent'];
- }
-
- if ($result['total_estimated'] > 0) {
- $values['time_estimated'] = $result['total_estimated'];
- }
-
- if (empty($values)) {
- return true;
- }
+ $values = $this->calculateSubtaskTime($task_id);
return $this->db
->table(Task::TABLE)
@@ -373,8 +360,8 @@ class SubtaskTimeTracking extends Base
->table(Subtask::TABLE)
->eq('task_id', $task_id)
->columns(
- 'SUM(time_spent) AS total_spent',
- 'SUM(time_estimated) AS total_estimated'
+ 'SUM(time_spent) AS time_spent',
+ 'SUM(time_estimated) AS time_estimated'
)
->findOne();
}