summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Model/SubtaskTimeTracking.php16
-rw-r--r--app/Template/task/time_tracking.php2
2 files changed, 7 insertions, 11 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'],
+ ));
}
}
diff --git a/app/Template/task/time_tracking.php b/app/Template/task/time_tracking.php
index 6e86df91..1dea0f0b 100644
--- a/app/Template/task/time_tracking.php
+++ b/app/Template/task/time_tracking.php
@@ -7,7 +7,7 @@
<table class="table-fixed">
<tr>
<th class="column-20"><?= $subtask_paginator->order(t('User'), 'username') ?></th>
- <th class="column-40"><?= $subtask_paginator->order(t('Subtask'), 'subtask_title') ?></th>
+ <th class="column-30"><?= $subtask_paginator->order(t('Subtask'), 'subtask_title') ?></th>
<th><?= $subtask_paginator->order(t('Start'), 'start') ?></th>
<th><?= $subtask_paginator->order(t('End'), 'end') ?></th>
</tr>