summaryrefslogtreecommitdiff
path: root/app/Controller/Taskduplication.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-15 18:31:47 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-15 18:31:47 -0400
commit67b836164997527b91452b19adbcb8aa3c5decf1 (patch)
treeb5876d311912e97b0592c7e208639f7b52813a75 /app/Controller/Taskduplication.php
parent108e867605dbc7ece4cbcbecc89a674e9c154a9b (diff)
Refactoring: added controlled middleware and changed response class
Diffstat (limited to 'app/Controller/Taskduplication.php')
-rw-r--r--app/Controller/Taskduplication.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/Controller/Taskduplication.php b/app/Controller/Taskduplication.php
index 8fca930d..ff60228e 100644
--- a/app/Controller/Taskduplication.php
+++ b/app/Controller/Taskduplication.php
@@ -8,7 +8,7 @@ namespace Kanboard\Controller;
* @package controller
* @author Frederic Guillot
*/
-class Taskduplication extends Base
+class Taskduplication extends BaseController
{
/**
* Duplicate a task
@@ -25,14 +25,14 @@ class Taskduplication extends Base
if ($task_id > 0) {
$this->flash->success(t('Task created successfully.'));
- $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task_id)));
+ return $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task_id)));
} else {
$this->flash->failure(t('Unable to create this task.'));
- $this->response->redirect($this->helper->url->to('taskduplication', 'duplicate', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true);
+ return $this->response->redirect($this->helper->url->to('taskduplication', 'duplicate', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true);
}
}
- $this->response->html($this->template->render('task_duplication/duplicate', array(
+ return $this->response->html($this->template->render('task_duplication/duplicate', array(
'task' => $task,
)));
}
@@ -57,13 +57,13 @@ class Taskduplication extends Base
$values['category_id'],
$values['owner_id'])) {
$this->flash->success(t('Task updated successfully.'));
- $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $values['project_id'], 'task_id' => $task['id'])));
+ return $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $values['project_id'], 'task_id' => $task['id'])));
}
$this->flash->failure(t('Unable to update your task.'));
}
- $this->chooseDestination($task, 'task_duplication/move');
+ return $this->chooseDestination($task, 'task_duplication/move');
}
/**
@@ -87,14 +87,14 @@ class Taskduplication extends Base
if ($task_id > 0) {
$this->flash->success(t('Task created successfully.'));
- $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $values['project_id'], 'task_id' => $task_id)));
+ return $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $values['project_id'], 'task_id' => $task_id)));
}
}
$this->flash->failure(t('Unable to create your task.'));
}
- $this->chooseDestination($task, 'task_duplication/copy');
+ return $this->chooseDestination($task, 'task_duplication/copy');
}
/**