diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-02-07 19:39:39 -0500 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-02-07 19:39:39 -0500 |
| commit | 2d890cbc712371f17ba4bbceb02af3c5ba04e6da (patch) | |
| tree | f16630432aa7fa22ebc3784839ed77c55e96e6a8 /app/Model/TimeTracking.php | |
| parent | fa6d19928abcfa03861e264222dbe46ad2fdc15a (diff) | |
Update task time tracking based on subtask time tracking
Diffstat (limited to 'app/Model/TimeTracking.php')
| -rw-r--r-- | app/Model/TimeTracking.php | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/app/Model/TimeTracking.php b/app/Model/TimeTracking.php deleted file mode 100644 index 4ddddf12..00000000 --- a/app/Model/TimeTracking.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Model; - -/** - * Time tracking model - * - * @package model - * @author Frederic Guillot - */ -class TimeTracking extends Base -{ - /** - * Calculate time metrics for a task - * - * Use subtasks time metrics if not empty otherwise return task time metrics - * - * @access public - * @param array $task Task properties - * @param array $subtasks Subtasks list - * @return array - */ - public function getTaskTimesheet(array $task, array $subtasks) - { - $timesheet = array( - 'time_spent' => 0, - 'time_estimated' => 0, - 'time_remaining' => 0, - ); - - foreach ($subtasks as &$subtask) { - $timesheet['time_estimated'] += $subtask['time_estimated']; - $timesheet['time_spent'] += $subtask['time_spent']; - } - - if ($timesheet['time_estimated'] == 0 && $timesheet['time_spent'] == 0) { - $timesheet['time_estimated'] = $task['time_estimated']; - $timesheet['time_spent'] = $task['time_spent']; - } - - $timesheet['time_remaining'] = $timesheet['time_estimated'] - $timesheet['time_spent']; - - return $timesheet; - } -} |
