From 8d43897e26d0979184978ee731331e051fb086ed Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 12 Aug 2015 22:17:01 -0400 Subject: Fix bug task estimate is reseted when using subtask timer --- app/Model/SubtaskTimeTracking.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'app/Model/SubtaskTimeTracking.php') diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php index 9f17ee3f..8f8aac94 100644 --- a/app/Model/SubtaskTimeTracking.php +++ b/app/Model/SubtaskTimeTracking.php @@ -301,7 +301,6 @@ class SubtaskTimeTracking extends Base ->findOneColumn('start'); if ($start_time) { - $start = new DateTime; $start->setTimestamp($start_time); @@ -349,10 +348,9 @@ class SubtaskTimeTracking extends Base return $this->db ->table(Task::TABLE) ->eq('id', $task_id) - ->update(array( - 'time_spent' => $result['total_spent'], - 'time_estimated' => $result['total_estimated'], - )); + ->sumColumn('time_spent', $result['total_spent']) + ->sumColumn('time_estimated', $result['total_estimated']) + ->update(); } /** -- cgit v1.2.3