From 321b1914ef1ee4d7e1a39d60fddd1151cb195f9c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 Feb 2015 19:35:28 -0500 Subject: Display confirmation box to close task from the board and improve popover listeners --- app/Controller/Task.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/Controller') 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, ))); } -- cgit v1.2.3