summaryrefslogtreecommitdiff
path: root/controllers/task.php
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-24 19:07:25 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-24 19:07:25 -0500
commit565290fbf9e3727655921a969550167aa59a6e24 (patch)
tree0c3a98b1152e90eff86da26d9d9c8ec803dfdf95 /controllers/task.php
parent8159cc99a64cfe563dccea6821348764fc40fb85 (diff)
Display a page not found when the data is not in the dabase anymore
Diffstat (limited to 'controllers/task.php')
-rw-r--r--controllers/task.php16
1 files changed, 14 insertions, 2 deletions
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')
)));