From 5cc488947305eea5b9762997222c84d6007761c8 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 1 Apr 2017 17:04:18 -0400 Subject: Move Gantt charts to external plugin --- app/Formatter/TaskGanttFormatter.php | 78 ------------------------------------ 1 file changed, 78 deletions(-) delete mode 100644 app/Formatter/TaskGanttFormatter.php (limited to 'app/Formatter/TaskGanttFormatter.php') diff --git a/app/Formatter/TaskGanttFormatter.php b/app/Formatter/TaskGanttFormatter.php deleted file mode 100644 index ddb3f93a..00000000 --- a/app/Formatter/TaskGanttFormatter.php +++ /dev/null @@ -1,78 +0,0 @@ -query->findAll() as $task) { - $bars[] = $this->formatTask($task); - } - - return $bars; - } - - /** - * Format a single task - * - * @access private - * @param array $task - * @return array - */ - private function formatTask(array $task) - { - if (! isset($this->columns[$task['project_id']])) { - $this->columns[$task['project_id']] = $this->columnModel->getList($task['project_id']); - } - - $start = $task['date_started'] ?: time(); - $end = $task['date_due'] ?: $start; - - return array( - 'type' => 'task', - 'id' => $task['id'], - 'title' => $task['title'], - 'start' => array( - (int) date('Y', $start), - (int) date('n', $start), - (int) date('j', $start), - ), - 'end' => array( - (int) date('Y', $end), - (int) date('n', $end), - (int) date('j', $end), - ), - 'column_title' => $task['column_name'], - 'assignee' => $task['assignee_name'] ?: $task['assignee_username'], - 'progress' => $this->taskModel->getProgress($task, $this->columns[$task['project_id']]).'%', - 'link' => $this->helper->url->href('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), - 'color' => $this->colorModel->getColorProperties($task['color_id']), - 'not_defined' => empty($task['date_due']) || empty($task['date_started']), - ); - } -} -- cgit v1.2.3