From 14713b0ec7ed93ca45578da069ad4e19a7d8addf Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 May 2016 19:48:22 -0400 Subject: Rename all models --- app/Formatter/BoardFormatter.php | 8 ++++---- app/Formatter/ProjectActivityEventFormatter.php | 2 +- app/Formatter/ProjectGanttFormatter.php | 4 ++-- app/Formatter/SubtaskTimeTrackingCalendarFormatter.php | 4 ++-- app/Formatter/TaskAutoCompleteFormatter.php | 4 ++-- app/Formatter/TaskCalendarFormatter.php | 6 +++--- app/Formatter/TaskGanttFormatter.php | 6 +++--- app/Formatter/UserAutoCompleteFormatter.php | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'app/Formatter') diff --git a/app/Formatter/BoardFormatter.php b/app/Formatter/BoardFormatter.php index 6a96b3e6..dbc7cf21 100644 --- a/app/Formatter/BoardFormatter.php +++ b/app/Formatter/BoardFormatter.php @@ -3,7 +3,7 @@ namespace Kanboard\Formatter; use Kanboard\Core\Filter\FormatterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Board Formatter @@ -43,11 +43,11 @@ class BoardFormatter extends BaseFormatter implements FormatterInterface public function format() { $tasks = $this->query - ->eq(Task::TABLE.'.project_id', $this->projectId) - ->asc(Task::TABLE.'.position') + ->eq(TaskModel::TABLE.'.project_id', $this->projectId) + ->asc(TaskModel::TABLE.'.position') ->findAll(); - return $this->board->getBoard($this->projectId, function ($project_id, $column_id, $swimlane_id) use ($tasks) { + return $this->boardModel->getBoard($this->projectId, function ($project_id, $column_id, $swimlane_id) use ($tasks) { return array_filter($tasks, function (array $task) use ($column_id, $swimlane_id) { return $task['column_id'] == $column_id && $task['swimlane_id'] == $swimlane_id; }); diff --git a/app/Formatter/ProjectActivityEventFormatter.php b/app/Formatter/ProjectActivityEventFormatter.php index ae80e5e7..aa0ea7cd 100644 --- a/app/Formatter/ProjectActivityEventFormatter.php +++ b/app/Formatter/ProjectActivityEventFormatter.php @@ -21,7 +21,7 @@ class ProjectActivityEventFormatter extends BaseFormatter implements FormatterIn unset($event['data']); $event['author'] = $event['author_name'] ?: $event['author_username']; - $event['event_title'] = $this->notification->getTitleWithAuthor($event['author'], $event['event_name'], $event); + $event['event_title'] = $this->notificationModel->getTitleWithAuthor($event['author'], $event['event_name'], $event); $event['event_content'] = $this->renderEvent($event); } diff --git a/app/Formatter/ProjectGanttFormatter.php b/app/Formatter/ProjectGanttFormatter.php index 2400ed70..af04f498 100644 --- a/app/Formatter/ProjectGanttFormatter.php +++ b/app/Formatter/ProjectGanttFormatter.php @@ -21,7 +21,7 @@ class ProjectGanttFormatter extends BaseFormatter implements FormatterInterface public function format() { $projects = $this->query->findAll(); - $colors = $this->color->getDefaultColors(); + $colors = $this->colorModel->getDefaultColors(); $bars = array(); foreach ($projects as $project) { @@ -48,7 +48,7 @@ class ProjectGanttFormatter extends BaseFormatter implements FormatterInterface 'gantt_link' => $this->helper->url->href('TaskGanttController', 'show', array('project_id' => $project['id'])), 'color' => $color, 'not_defined' => empty($project['start_date']) || empty($project['end_date']), - 'users' => $this->projectUserRole->getAllUsersGroupedByRole($project['id']), + 'users' => $this->projectUserRoleModel->getAllUsersGroupedByRole($project['id']), ); } diff --git a/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php b/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php index 047a39b9..b7b81d87 100644 --- a/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php +++ b/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php @@ -25,8 +25,8 @@ class SubtaskTimeTrackingCalendarFormatter extends BaseFormatter implements Form 'title' => t('#%d', $row['task_id']).' '.$row['subtask_title'].$user, 'start' => date('Y-m-d\TH:i:s', $row['start']), 'end' => date('Y-m-d\TH:i:s', $row['end'] ?: time()), - 'backgroundColor' => $this->color->getBackgroundColor($row['color_id']), - 'borderColor' => $this->color->getBorderColor($row['color_id']), + 'backgroundColor' => $this->colorModel->getBackgroundColor($row['color_id']), + 'borderColor' => $this->colorModel->getBorderColor($row['color_id']), 'textColor' => 'black', 'url' => $this->helper->url->to('TaskViewController', 'show', array('task_id' => $row['task_id'], 'project_id' => $row['project_id'])), 'editable' => false, diff --git a/app/Formatter/TaskAutoCompleteFormatter.php b/app/Formatter/TaskAutoCompleteFormatter.php index 480ee797..4f1c4c69 100644 --- a/app/Formatter/TaskAutoCompleteFormatter.php +++ b/app/Formatter/TaskAutoCompleteFormatter.php @@ -3,7 +3,7 @@ namespace Kanboard\Formatter; use Kanboard\Core\Filter\FormatterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Task AutoComplete Formatter @@ -21,7 +21,7 @@ class TaskAutoCompleteFormatter extends BaseFormatter implements FormatterInterf */ public function format() { - $tasks = $this->query->columns(Task::TABLE.'.id', Task::TABLE.'.title')->findAll(); + $tasks = $this->query->columns(TaskModel::TABLE.'.id', TaskModel::TABLE.'.title')->findAll(); foreach ($tasks as &$task) { $task['value'] = $task['title']; diff --git a/app/Formatter/TaskCalendarFormatter.php b/app/Formatter/TaskCalendarFormatter.php index d478d2bd..75d2a83e 100644 --- a/app/Formatter/TaskCalendarFormatter.php +++ b/app/Formatter/TaskCalendarFormatter.php @@ -44,11 +44,11 @@ class TaskCalendarFormatter extends BaseTaskCalendarFormatter implements Formatt foreach ($this->query->findAll() as $task) { $events[] = array( - 'timezoneParam' => $this->timezone->getCurrentTimezone(), + 'timezoneParam' => $this->timezoneModel->getCurrentTimezone(), 'id' => $task['id'], 'title' => t('#%d', $task['id']).' '.$task['title'], - 'backgroundColor' => $this->color->getBackgroundColor($task['color_id']), - 'borderColor' => $this->color->getBorderColor($task['color_id']), + '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]), diff --git a/app/Formatter/TaskGanttFormatter.php b/app/Formatter/TaskGanttFormatter.php index 4ff5c019..ddb3f93a 100644 --- a/app/Formatter/TaskGanttFormatter.php +++ b/app/Formatter/TaskGanttFormatter.php @@ -47,7 +47,7 @@ class TaskGanttFormatter extends BaseFormatter implements FormatterInterface private function formatTask(array $task) { if (! isset($this->columns[$task['project_id']])) { - $this->columns[$task['project_id']] = $this->column->getList($task['project_id']); + $this->columns[$task['project_id']] = $this->columnModel->getList($task['project_id']); } $start = $task['date_started'] ?: time(); @@ -69,9 +69,9 @@ class TaskGanttFormatter extends BaseFormatter implements FormatterInterface ), 'column_title' => $task['column_name'], 'assignee' => $task['assignee_name'] ?: $task['assignee_username'], - 'progress' => $this->task->getProgress($task, $this->columns[$task['project_id']]).'%', + '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->color->getColorProperties($task['color_id']), + 'color' => $this->colorModel->getColorProperties($task['color_id']), 'not_defined' => empty($task['date_due']) || empty($task['date_started']), ); } diff --git a/app/Formatter/UserAutoCompleteFormatter.php b/app/Formatter/UserAutoCompleteFormatter.php index c46a24d0..cd23a2a4 100644 --- a/app/Formatter/UserAutoCompleteFormatter.php +++ b/app/Formatter/UserAutoCompleteFormatter.php @@ -2,7 +2,7 @@ namespace Kanboard\Formatter; -use Kanboard\Model\User; +use Kanboard\Model\UserModel; use Kanboard\Core\Filter\FormatterInterface; /** @@ -21,7 +21,7 @@ class UserAutoCompleteFormatter extends BaseFormatter implements FormatterInterf */ public function format() { - $users = $this->query->columns(User::TABLE.'.id', User::TABLE.'.username', User::TABLE.'.name')->findAll(); + $users = $this->query->columns(UserModel::TABLE.'.id', UserModel::TABLE.'.username', UserModel::TABLE.'.name')->findAll(); foreach ($users as &$user) { $user['value'] = $user['username'].' (#'.$user['id'].')'; -- cgit v1.2.3