diff options
Diffstat (limited to 'app/Model/TaskAnalytic.php')
-rw-r--r-- | app/Model/TaskAnalytic.php | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/app/Model/TaskAnalytic.php b/app/Model/TaskAnalytic.php deleted file mode 100644 index bf118b4e..00000000 --- a/app/Model/TaskAnalytic.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -namespace Kanboard\Model; - -use Kanboard\Core\Base; - -/** - * Task Analytic - * - * @package model - * @author Frederic Guillot - */ -class TaskAnalytic extends Base -{ - /** - * Get the time between date_creation and date_completed or now if empty - * - * @access public - * @param array $task - * @return integer - */ - public function getLeadTime(array $task) - { - return ($task['date_completed'] ?: time()) - $task['date_creation']; - } - - /** - * Get the time between date_started and date_completed or now if empty - * - * @access public - * @param array $task - * @return integer - */ - public function getCycleTime(array $task) - { - if (empty($task['date_started'])) { - return 0; - } - - return ($task['date_completed'] ?: time()) - $task['date_started']; - } - - /** - * Get the average time spent in each column - * - * @access public - * @param array $task - * @return array - */ - public function getTimeSpentByColumn(array $task) - { - $result = array(); - $columns = $this->column->getList($task['project_id']); - $sums = $this->transition->getTimeSpentByTask($task['id']); - - foreach ($columns as $column_id => $column_title) { - $time_spent = isset($sums[$column_id]) ? $sums[$column_id] : 0; - - if ($task['column_id'] == $column_id) { - $time_spent += ($task['date_completed'] ?: time()) - $task['date_moved']; - } - - $result[] = array( - 'id' => $column_id, - 'title' => $column_title, - 'time_spent' => $time_spent, - ); - } - - return $result; - } -} |