Show project name in task forms

This commit is contained in:
Frederic Guillot
2016-08-07 10:31:48 -04:00
parent 928d27d2ad
commit c0ee8b4092
7 changed files with 63 additions and 40 deletions

View File

@@ -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);
}
}