summaryrefslogtreecommitdiff
path: root/app/Controller/Task.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-08 23:19:40 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-08 23:19:40 +0200
commite383c069f1aeba49ea9905f77a51bf663e614b0e (patch)
tree8164aa9e1fad104997e53c6e261bec991631dbbb /app/Controller/Task.php
parent8c6df9ef0cea757d25cbbcc6fa7cee86d8739627 (diff)
Add public view for tasks
Diffstat (limited to 'app/Controller/Task.php')
-rw-r--r--app/Controller/Task.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index 7210be5f..97751947 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -47,6 +47,39 @@ class Task extends Base
}
/**
+ * Public access (display a task)
+ *
+ * @access public
+ */
+ public function readonly()
+ {
+ $project = $this->project->getByToken($this->request->getStringParam('token'));
+
+ // Token verification
+ if (! $project) {
+ $this->forbidden(true);
+ }
+
+ $task = $this->task->getById($this->request->getIntegerParam('task_id'), true);
+
+ if (! $task) {
+ $this->notfound(true);
+ }
+
+ $this->response->html($this->template->layout('task_public', array(
+ 'project' => $project,
+ 'comments' => $this->comment->getAll($task['id']),
+ 'subtasks' => $this->subTask->getAll($task['id']),
+ 'task' => $task,
+ 'columns_list' => $this->board->getColumnsList($task['project_id']),
+ 'colors_list' => $this->task->getColors(),
+ 'title' => $task['title'],
+ 'no_layout' => true,
+ 'auto_refresh' => true,
+ )));
+ }
+
+ /**
* Show a task
*
* @access public
@@ -56,6 +89,7 @@ class Task extends Base
$task = $this->getTask();
$this->response->html($this->taskLayout('task_show', array(
+ 'project' => $this->project->getById($task['project_id']),
'files' => $this->file->getAll($task['id']),
'comments' => $this->comment->getAll($task['id']),
'subtasks' => $this->subTask->getAll($task['id']),