diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-02-15 19:35:28 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-02-15 19:35:28 -0500 |
commit | 321b1914ef1ee4d7e1a39d60fddd1151cb195f9c (patch) | |
tree | fede454cbf957df30cb0639c460a301e49bdfd34 /app/Controller | |
parent | 186f8ba840e5e6e00a96881a04bb7efdf3d8c7d4 (diff) |
Display confirmation box to close task from the board and improve popover listeners
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/Task.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/Controller/Task.php b/app/Controller/Task.php index e561d5f7..741db61e 100644 --- a/app/Controller/Task.php +++ b/app/Controller/Task.php @@ -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, ))); } |