summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Action.php4
-rw-r--r--app/Controller/Base.php3
-rw-r--r--app/Controller/Board.php4
-rw-r--r--app/Controller/Project.php2
-rw-r--r--app/Controller/Task.php22
5 files changed, 19 insertions, 16 deletions
diff --git a/app/Controller/Action.php b/app/Controller/Action.php
index b2f80009..0bf8ff0c 100644
--- a/app/Controller/Action.php
+++ b/app/Controller/Action.php
@@ -29,7 +29,7 @@ class Action extends Base
'columns_list' => $this->board->getColumnsList($project['id']),
'users_list' => $this->project->getUsersList($project['id']),
'projects_list' => $this->project->getList(false),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($project['id']),
'menu' => 'projects',
'title' => t('Automatic actions')
@@ -53,7 +53,7 @@ class Action extends Base
'columns_list' => $this->board->getColumnsList($project['id']),
'users_list' => $this->project->getUsersList($project['id']),
'projects_list' => $this->project->getList(false),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($project['id']),
'project' => $project,
'menu' => 'projects',
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index 93749ea6..383b22d1 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -19,6 +19,7 @@ use Model\LastLogin;
* @property \Model\Action $action
* @property \Model\Board $board
* @property \Model\Category $category
+ * @property \Model\Color $color
* @property \Model\Comment $comment
* @property \Model\Config $config
* @property \Model\File $file
@@ -28,6 +29,8 @@ use Model\LastLogin;
* @property \Model\SubTask $subTask
* @property \Model\Task $task
* @property \Model\TaskHistory $taskHistory
+ * @property \Model\TaskExport $taskExport
+ * @property \Model\TaskValidator $taskValidator
* @property \Model\CommentHistory $commentHistory
* @property \Model\SubtaskHistory $subtaskHistory
* @property \Model\User $user
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index f643408d..e002ce3b 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -88,7 +88,7 @@ class Board extends Base
$values = $this->request->getValues();
$this->checkProjectPermissions($values['project_id']);
- list($valid,) = $this->task->validateAssigneeModification($values);
+ list($valid,) = $this->taskValidator->validateAssigneeModification($values);
if ($valid && $this->task->update($values)) {
$this->session->flash(t('Task updated successfully.'));
@@ -142,7 +142,7 @@ class Board extends Base
$values = $this->request->getValues();
$this->checkProjectPermissions($values['project_id']);
- list($valid,) = $this->task->validateCategoryModification($values);
+ list($valid,) = $this->taskValidator->validateCategoryModification($values);
if ($valid && $this->task->update($values)) {
$this->session->flash(t('Task updated successfully.'));
diff --git a/app/Controller/Project.php b/app/Controller/Project.php
index ef9eac6b..2459f094 100644
--- a/app/Controller/Project.php
+++ b/app/Controller/Project.php
@@ -72,7 +72,7 @@ class Project extends Base
$to = $this->request->getStringParam('to');
if ($from && $to) {
- $data = $this->task->export($project['id'], $from, $to);
+ $data = $this->taskExport->export($project['id'], $from, $to);
$this->response->forceDownload('Export_'.date('Y_m_d_H_i_S').'.csv');
$this->response->csv($data);
}
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index ef55fb57..d958c248 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -37,7 +37,7 @@ class Task extends Base
'category_id' => $this->request->getIntegerParam('category_id'),
);
- list($valid,) = $this->task->validateCreation($values);
+ list($valid,) = $this->taskValidator->validateCreation($values);
if ($valid && $this->task->create($values)) {
$this->response->text('OK');
@@ -72,7 +72,7 @@ class Task extends Base
'subtasks' => $this->subTask->getAll($task['id']),
'task' => $task,
'columns_list' => $this->board->getColumnsList($task['project_id']),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'title' => $task['title'],
'no_layout' => true,
'auto_refresh' => true,
@@ -96,7 +96,7 @@ class Task extends Base
'subtasks' => $this->subTask->getAll($task['id']),
'task' => $task,
'columns_list' => $this->board->getColumnsList($task['project_id']),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'menu' => 'tasks',
'title' => $task['title'],
)));
@@ -124,7 +124,7 @@ class Task extends Base
'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
'columns_list' => $this->board->getColumnsList($project_id),
'users_list' => $this->project->getUsersList($project_id),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($project_id),
'menu' => 'tasks',
'title' => t('New task')
@@ -143,7 +143,7 @@ class Task extends Base
$this->checkProjectPermissions($values['project_id']);
- list($valid, $errors) = $this->task->validateCreation($values);
+ list($valid, $errors) = $this->taskValidator->validateCreation($values);
if ($valid) {
@@ -170,7 +170,7 @@ class Task extends Base
'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
'columns_list' => $this->board->getColumnsList($values['project_id']),
'users_list' => $this->project->getUsersList($values['project_id']),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($values['project_id']),
'menu' => 'tasks',
'title' => t('New task')
@@ -200,7 +200,7 @@ class Task extends Base
'errors' => array(),
'task' => $task,
'users_list' => $this->project->getUsersList($task['project_id']),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($task['project_id']),
'ajax' => $this->request->isAjax(),
'menu' => 'tasks',
@@ -224,7 +224,7 @@ class Task extends Base
$task = $this->getTask();
$values = $this->request->getValues();
- list($valid, $errors) = $this->task->validateModification($values);
+ list($valid, $errors) = $this->taskValidator->validateModification($values);
if ($valid) {
@@ -249,7 +249,7 @@ class Task extends Base
'task' => $task,
'columns_list' => $this->board->getColumnsList($values['project_id']),
'users_list' => $this->project->getUsersList($values['project_id']),
- 'colors_list' => $this->task->getColors(),
+ 'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($values['project_id']),
'menu' => 'tasks',
'title' => t('Edit a task')
@@ -387,7 +387,7 @@ class Task extends Base
$values = $this->request->getValues();
- list($valid, $errors) = $this->task->validateDescriptionCreation($values);
+ list($valid, $errors) = $this->taskValidator->validateDescriptionCreation($values);
if ($valid) {
@@ -465,7 +465,7 @@ class Task extends Base
if ($this->request->isPost()) {
$values = $this->request->getValues();
- list($valid, $errors) = $this->task->validateProjectModification($values);
+ list($valid, $errors) = $this->taskValidator->validateProjectModification($values);
if ($valid) {
$task_id = $this->task->{$action.'ToAnotherProject'}($values['project_id'], $task);