diff options
Diffstat (limited to 'app/Controller/TaskGanttCreationController.php')
-rw-r--r-- | app/Controller/TaskGanttCreationController.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/app/Controller/TaskGanttCreationController.php b/app/Controller/TaskGanttCreationController.php index 07b74a49..0fbac8bb 100644 --- a/app/Controller/TaskGanttCreationController.php +++ b/app/Controller/TaskGanttCreationController.php @@ -38,7 +38,6 @@ class TaskGanttCreationController extends BaseController 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, true), 'categories_list' => $this->categoryModel->getList($project['id']), 'swimlanes_list' => $this->swimlaneModel->getList($project['id'], false, true), - 'title' => $project['name'].' > '.t('New task') ))); } @@ -54,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); } } |