Improve dashboard pagination

This commit is contained in:
Frédéric Guillot
2018-05-09 11:21:57 -07:00
parent cc17cb3207
commit 6ae97d399d
3 changed files with 23 additions and 7 deletions

View File

@@ -32,13 +32,13 @@ class DashboardPagination extends Base
$this->hook->reference('pagination:dashboard:task:query', $query);
$paginator = $this->paginator
->setUrl('DashboardController', 'show', array('user_id' => $userId))
->setMax(50)
->setUrl('DashboardController', 'show', array('user_id' => $userId, 'pagination' => 'tasks-'.$projectId), 'project-tasks-'.$projectId)
->setMax(15)
->setOrder(TaskModel::TABLE.'.priority')
->setDirection('DESC')
->setFormatter($this->taskListSubtaskAssigneeFormatter->withUserId($userId))
->setQuery($query)
->calculate();
->calculateOnlyIf($this->request->getStringParam('pagination') === 'tasks-'.$projectId);
if ($paginator->getTotal() > 0) {
$paginators[] = array(