From 565290fbf9e3727655921a969550167aa59a6e24 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 24 Feb 2014 19:07:25 -0500 Subject: Display a page not found when the data is not in the dabase anymore --- controllers/task.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'controllers/task.php') diff --git a/controllers/task.php b/controllers/task.php index bff29f8c..3aa486d5 100644 --- a/controllers/task.php +++ b/controllers/task.php @@ -44,6 +44,8 @@ class Task extends Base { $task = $this->task->getById($this->request->getIntegerParam('task_id'), true); + if (! $task) $this->notfound(); + $this->response->html($this->template->layout('task_show', array( 'task' => $task, 'columns_list' => $this->board->getColumnsList($task['project_id']), @@ -118,6 +120,8 @@ class Task extends Base { $task = $this->task->getById($this->request->getIntegerParam('task_id')); + if (! $task) $this->notfound(); + $this->response->html($this->template->layout('task_edit', array( 'errors' => array(), 'values' => $task, @@ -174,8 +178,12 @@ class Task extends Base // Confirmation dialog before to close a task public function confirmClose() { + $task = $this->task->getById($this->request->getIntegerParam('task_id')); + + if (! $task) $this->notfound(); + $this->response->html($this->template->layout('task_close', array( - 'task' => $this->task->getById($this->request->getIntegerParam('task_id')), + 'task' => $task, 'menu' => 'tasks', 'title' => t('Close a task') ))); @@ -198,8 +206,12 @@ class Task extends Base // Confirmation dialog before to open a task public function confirmOpen() { + $task = $this->task->getById($this->request->getIntegerParam('task_id')); + + if (! $task) $this->notfound(); + $this->response->html($this->template->layout('task_open', array( - 'task' => $this->task->getById($this->request->getIntegerParam('task_id')), + 'task' => $task, 'menu' => 'tasks', 'title' => t('Open a task') ))); -- cgit v1.2.3