summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--app/Controller/Taskduplication.php19
2 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index e1c62289..507e458b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@ Core functionalities moved to plugins:
Improvements:
+* When duplicating a task redirect to the new task
* Include more shortcut links into the view "My projects"
* Duplicate a project with tasks will copy the new tasks in the same columns
* Offer alternative method to create Mysql and Postgres databases (import sql dump)
diff --git a/app/Controller/Taskduplication.php b/app/Controller/Taskduplication.php
index aebbcfc1..8d329ca4 100644
--- a/app/Controller/Taskduplication.php
+++ b/app/Controller/Taskduplication.php
@@ -26,7 +26,7 @@ class Taskduplication extends Base
if ($task_id > 0) {
$this->session->flash(t('Task created successfully.'));
- $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task_id)));
} else {
$this->session->flashError(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'])));
@@ -83,15 +83,16 @@ class Taskduplication extends Base
$values = $this->request->getValues();
list($valid,) = $this->taskValidator->validateProjectModification($values);
- if ($valid && $this->taskDuplication->duplicateToProject($task['id'],
- $values['project_id'],
- $values['swimlane_id'],
- $values['column_id'],
- $values['category_id'],
- $values['owner_id'])) {
+ if ($valid) {
+ $task_id = $this->taskDuplication->duplicateToProject(
+ $task['id'], $values['project_id'], $values['swimlane_id'],
+ $values['column_id'], $values['category_id'], $values['owner_id']
+ );
- $this->session->flash(t('Task created successfully.'));
- $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+ if ($task_id > 0) {
+ $this->session->flash(t('Task created successfully.'));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $values['project_id'], 'task_id' => $task_id)));
+ }
}
$this->session->flashError(t('Unable to create your task.'));