Display confirmation box to close task from the board and improve popover listeners

This commit is contained in:
Frederic Guillot
2015-02-15 19:35:28 -05:00
parent 186f8ba840
commit 321b1914ef
11 changed files with 46 additions and 51 deletions

View File

@@ -251,6 +251,7 @@ class Task extends Base
public function close()
{
$task = $this->getTask();
$redirect = $this->request->getStringParam('redirect');
if ($this->request->getStringParam('confirmation') === 'yes') {
@@ -262,15 +263,23 @@ class Task extends Base
$this->session->flashError(t('Unable to close this task.'));
}
if ($this->request->getStringParam('redirect') === 'board') {
if ($redirect === 'board') {
$this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id'])));
}
$this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
if ($this->request->isAjax()) {
$this->response->html($this->template->render('task/close', array(
'task' => $task,
'redirect' => $redirect,
)));
}
$this->response->html($this->taskLayout('task/close', array(
'task' => $task,
'redirect' => $redirect,
)));
}