From 24300f828a684eedf71d63374effb2be95c13b1a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 1 Feb 2015 19:34:01 -0500 Subject: Add shortcut link to close a task from the dropdown menu --- app/Controller/Task.php | 6 +++++- app/Template/board/task.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/Controller/Task.php b/app/Controller/Task.php index c25a4b9d..205e480f 100644 --- a/app/Controller/Task.php +++ b/app/Controller/Task.php @@ -261,7 +261,11 @@ class Task extends Base $this->session->flashError(t('Unable to close this task.')); } - $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id']); + if ($this->request->getStringParam('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']))); } $this->response->html($this->taskLayout('task/close', array( diff --git a/app/Template/board/task.php b/app/Template/board/task.php index 546fbe1b..41c7ab45 100644 --- a/app/Template/board/task.php +++ b/app/Template/board/task.php @@ -46,6 +46,7 @@
  • a(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'category-popover') ?>
  • a(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-description-popover') ?>
  • a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-edit-popover') ?>
  • +
  • a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => 'board'), true) ?>
  • -- cgit v1.2.3