summaryrefslogtreecommitdiff
path: root/app/Controller/TaskGanttCreationController.php
diff options
context:
space:
mode:
authorJLGC @monolinux <monolinux@junglacode.org>2016-08-15 23:13:16 -0500
committerJLGC @monolinux <monolinux@junglacode.org>2016-08-15 23:13:16 -0500
commit683c0464093f6a7976236c68653c2a2cc5dae280 (patch)
treebf176ecd82415cc4952eea071b7d264dd5fd68b4 /app/Controller/TaskGanttCreationController.php
parentb1e795fc5b45369f7b9b565b1e106d2673361977 (diff)
parent5f82a942c0011bf91947b2c1d627c0907bda0c92 (diff)
Merge https://github.com/kanboard/kanboard
Diffstat (limited to 'app/Controller/TaskGanttCreationController.php')
-rw-r--r--app/Controller/TaskGanttCreationController.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/app/Controller/TaskGanttCreationController.php b/app/Controller/TaskGanttCreationController.php
index c2998a3e..0fbac8bb 100644
--- a/app/Controller/TaskGanttCreationController.php
+++ b/app/Controller/TaskGanttCreationController.php
@@ -36,10 +36,8 @@ class TaskGanttCreationController extends BaseController
'errors' => $errors,
'values' => $values,
'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, true),
- 'colors_list' => $this->colorModel->getList(),
'categories_list' => $this->categoryModel->getList($project['id']),
'swimlanes_list' => $this->swimlaneModel->getList($project['id'], false, true),
- 'title' => $project['name'].' &gt; '.t('New task')
)));
}
@@ -55,17 +53,12 @@ class TaskGanttCreationController extends BaseController
list($valid, $errors) = $this->taskValidator->validateCreation($values);
- if ($valid) {
- $task_id = $this->taskCreationModel->create($values);
-
- if ($task_id !== false) {
- $this->flash->success(t('Task created successfully.'));
- return $this->response->redirect($this->helper->url->to('TaskGanttController', 'show', array('project_id' => $project['id'])));
- } else {
- $this->flash->failure(t('Unable to create your task.'));
- }
+ if ($valid && $this->taskCreationModel->create($values)) {
+ $this->flash->success(t('Task created successfully.'));
+ $this->response->redirect($this->helper->url->to('TaskGanttController', 'show', array('project_id' => $project['id'])));
+ } else {
+ $this->flash->failure(t('Unable to create your task.'));
+ $this->show($values, $errors);
}
-
- return $this->show($values, $errors);
}
}