Fix wrong redirect after removing a task from the task view page

This commit is contained in:
Frederic Guillot
2016-05-28 17:26:33 -04:00
parent 9e218032c4
commit 88ee691bb9
7 changed files with 58 additions and 34 deletions

View File

@@ -143,34 +143,4 @@ class TaskViewController extends BaseController
'transitions' => $this->transition->getAllByTask($task['id']),
)));
}
/**
* Remove a task
*
* @access public
*/
public function remove()
{
$task = $this->getTask();
if (! $this->helper->user->canRemoveTask($task)) {
throw new AccessForbiddenException();
}
if ($this->request->getStringParam('confirmation') === 'yes') {
$this->checkCSRFParam();
if ($this->task->remove($task['id'])) {
$this->flash->success(t('Task removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this task.'));
}
return $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $task['project_id'])), true);
}
return $this->response->html($this->template->render('task/remove', array(
'task' => $task,
)));
}
}