Update task time spent based on subtasks time spent
This commit is contained in:
parent
4ec507724f
commit
10debb3f6c
|
|
@ -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'],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue