summaryrefslogtreecommitdiff
path: root/app/Controller/TaskCreationController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/TaskCreationController.php')
-rw-r--r--app/Controller/TaskCreationController.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/Controller/TaskCreationController.php b/app/Controller/TaskCreationController.php
index c68964f6..c754b029 100644
--- a/app/Controller/TaskCreationController.php
+++ b/app/Controller/TaskCreationController.php
@@ -52,12 +52,16 @@ class TaskCreationController extends BaseController
list($valid, $errors) = $this->taskValidator->validateCreation($values);
- if ($valid && ($task_id = $this->taskCreationModel->create($values))) {
- $this->flash->success(t('Task created successfully.'));
- $this->afterSave($project, $values, $task_id);
- } else {
+ if (! $valid) {
$this->flash->failure(t('Unable to create your task.'));
$this->show($values, $errors);
+ } else if (! $this->helper->projectRole->canCreateTaskInColumn($project['id'], $values['column_id'])) {
+ $this->flash->failure(t('You cannot create tasks in this column.'));
+ $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])), true);
+ } else {
+ $task_id = $this->taskCreationModel->create($values);
+ $this->flash->success(t('Task created successfully.'));
+ $this->afterSave($project, $values, $task_id);
}
}