From 6ae97d399dc96bd9a0e854bea6d09fa68e078ab5 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 9 May 2018 11:21:57 -0700 Subject: Improve dashboard pagination --- app/Pagination/DashboardPagination.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/Pagination') diff --git a/app/Pagination/DashboardPagination.php b/app/Pagination/DashboardPagination.php index 0149a42b..9669cb9d 100644 --- a/app/Pagination/DashboardPagination.php +++ b/app/Pagination/DashboardPagination.php @@ -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( -- cgit v1.2.3