From 253d5a9331e4b4775066ec8cb9664da9a2aa6ac9 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 1 Apr 2017 15:43:36 -0400 Subject: Move calendar to external plugin --- app/Formatter/TaskCalendarFormatter.php | 74 --------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 app/Formatter/TaskCalendarFormatter.php (limited to 'app/Formatter/TaskCalendarFormatter.php') diff --git a/app/Formatter/TaskCalendarFormatter.php b/app/Formatter/TaskCalendarFormatter.php deleted file mode 100644 index 75d2a83e..00000000 --- a/app/Formatter/TaskCalendarFormatter.php +++ /dev/null @@ -1,74 +0,0 @@ -fullDay = true; - return $this; - } - - /** - * Transform tasks to calendar events - * - * @access public - * @return array - */ - public function format() - { - $events = array(); - - foreach ($this->query->findAll() as $task) { - $events[] = array( - 'timezoneParam' => $this->timezoneModel->getCurrentTimezone(), - 'id' => $task['id'], - 'title' => t('#%d', $task['id']).' '.$task['title'], - 'backgroundColor' => $this->colorModel->getBackgroundColor($task['color_id']), - 'borderColor' => $this->colorModel->getBorderColor($task['color_id']), - 'textColor' => 'black', - 'url' => $this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - 'start' => date($this->getDateTimeFormat(), $task[$this->startColumn]), - 'end' => date($this->getDateTimeFormat(), $task[$this->endColumn] ?: time()), - 'editable' => $this->fullDay, - 'allday' => $this->fullDay, - ); - } - - return $events; - } - - /** - * Get DateTime format for event - * - * @access private - * @return string - */ - private function getDateTimeFormat() - { - return $this->fullDay ? 'Y-m-d' : 'Y-m-d\TH:i:s'; - } -} -- cgit v1.2.3