Add comments sorting
This commit is contained in:
@@ -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())
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user