diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-07 10:31:48 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-07 10:31:48 -0400 |
commit | c0ee8b409223ee38a24a7bbd896efe9386e785b2 (patch) | |
tree | 4f31a6fef1bcfbd0ff601bdb178d9adbb9170b81 /app/Controller/TaskGanttCreationController.php | |
parent | 928d27d2ad735d9c6c7ec4954a5a462181f482dd (diff) |
Show project name in task forms
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); } } |