summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Base.php2
-rw-r--r--app/Controller/Board.php2
-rw-r--r--app/Controller/Comment.php15
-rw-r--r--app/Controller/Task.php2
-rw-r--r--app/Controller/Taskstatus.php2
5 files changed, 18 insertions, 5 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index 480976b0..e0fd59cb 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -80,7 +80,7 @@ abstract class Base extends \Core\Base
private function sendHeaders($action)
{
// HTTP secure headers
- $this->response->csp(array('style-src' => "'self' 'unsafe-inline'", 'img-src' => '* data:'));
+ $this->response->csp($this->container['cspRules']);
$this->response->nosniff();
$this->response->xss();
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index 840db05b..a2cde287 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -195,7 +195,7 @@ class Board extends Base
$task = $this->getTask();
$this->response->html($this->template->render('board/tooltip_comments', array(
- 'comments' => $this->comment->getAll($task['id'])
+ 'comments' => $this->comment->getAll($task['id'], $this->userSession->getCommentSorting())
)));
}
diff --git a/app/Controller/Comment.php b/app/Controller/Comment.php
index 81fd7215..cf0af615 100644
--- a/app/Controller/Comment.php
+++ b/app/Controller/Comment.php
@@ -183,4 +183,19 @@ class Comment extends Base
$this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'));
}
+
+ /**
+ * Toggle comment sorting
+ *
+ * @access public
+ */
+ public function toggleSorting()
+ {
+ $task = $this->getTask();
+
+ $order = $this->userSession->getCommentSorting() === 'ASC' ? 'DESC' : 'ASC';
+ $this->userSession->setCommentSorting($order);
+
+ $this->response->redirect($this->helper->url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'comments'));
+ }
}
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index 0770fcd1..8e577839 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -68,7 +68,7 @@ class Task extends Base
'project' => $this->project->getById($task['project_id']),
'files' => $this->file->getAllDocuments($task['id']),
'images' => $this->file->getAllImages($task['id']),
- 'comments' => $this->comment->getAll($task['id']),
+ 'comments' => $this->comment->getAll($task['id'], $this->userSession->getCommentSorting()),
'subtasks' => $subtasks,
'links' => $this->taskLink->getAllGroupedByLabel($task['id']),
'task' => $task,
diff --git a/app/Controller/Taskstatus.php b/app/Controller/Taskstatus.php
index 9260b658..1768b773 100644
--- a/app/Controller/Taskstatus.php
+++ b/app/Controller/Taskstatus.php
@@ -30,8 +30,6 @@ class Taskstatus extends Base
public function open()
{
$task = $this->getTask();
- $redirect = $this->request->getStringParam('redirect');
-
$this->changeStatus($task, 'open', t('Task opened successfully.'), t('Unable to open this task.'));
$this->renderTemplate($task, 'task_status/open');
}