Open comments in board view with a modal dialog instead of tooltip

This commit is contained in:
Frederic Guillot
2017-02-11 17:22:10 -05:00
parent 28052edb22
commit 8bf054a480
26 changed files with 195 additions and 95 deletions

View File

@@ -4,7 +4,6 @@ namespace Kanboard\Controller;
use Kanboard\Core\Controller\AccessForbiddenException;
use Kanboard\Core\Controller\PageNotFoundException;
use Kanboard\Model\UserMetadataModel;
/**
* Comment Controller
@@ -17,12 +16,12 @@ class CommentController extends BaseController
/**
* Get the current comment
*
* @access private
* @access protected
* @return array
* @throws PageNotFoundException
* @throws AccessForbiddenException
*/
private function getComment()
protected function getComment()
{
$comment = $this->commentModel->getById($this->request->getIntegerParam('comment_id'));
@@ -77,6 +76,8 @@ class CommentController extends BaseController
{
$task = $this->getTask();
$values = $this->request->getValues();
$values['task_id'] = $task['id'];
$values['user_id'] = $this->userSession->getId();
list($valid, $errors) = $this->commentValidator->validateCreation($values);
@@ -118,7 +119,6 @@ class CommentController extends BaseController
'errors' => $errors,
'comment' => $comment,
'task' => $task,
'title' => t('Edit a comment')
)));
}
@@ -142,10 +142,11 @@ class CommentController extends BaseController
$this->flash->failure(t('Unable to update your comment.'));
}
return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), false);
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
return;
}
return $this->edit($values, $errors);
$this->edit($values, $errors);
}
/**
@@ -182,7 +183,7 @@ class CommentController extends BaseController
$this->flash->failure(t('Unable to remove this comment.'));
}
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'));
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'), true);
}
/**
@@ -193,11 +194,7 @@ class CommentController extends BaseController
public function toggleSorting()
{
$task = $this->getTask();
$oldDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');
$newDirection = $oldDirection === 'ASC' ? 'DESC' : 'ASC';
$this->userMetadataCacheDecorator->set(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, $newDirection);
$this->helper->comment->toggleSorting();
$this->response->redirect($this->helper->url->to(
'TaskViewController',