From 0dfe48b7fa475aade00a8ccf42e3dba99dfa3702 Mon Sep 17 00:00:00 2001 From: "Dzial Techniczny WMW Projekt s.c" Date: Wed, 8 Apr 2020 14:01:28 +0200 Subject: "My tasks" view grops tasks by project - fixes #107 --- app/Pagination/TaskPagination.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/Pagination/TaskPagination.php') diff --git a/app/Pagination/TaskPagination.php b/app/Pagination/TaskPagination.php index 53e05c13..29706cd5 100644 --- a/app/Pagination/TaskPagination.php +++ b/app/Pagination/TaskPagination.php @@ -36,4 +36,19 @@ class TaskPagination extends Base ->setFormatter($this->taskListFormatter) ->calculateOnlyIf($this->request->getStringParam('pagination') === 'tasks'); } + + public function getDashboardPerProjectPaginator($userId, $method, $max) + { + $query = $this->taskFinderModel->getUserQuery($userId); + $this->hook->reference('pagination:dashboard:task:query', $query); + + return $this->paginator + ->setUrl('DashboardController', $method, array('pagination' => 'tasks', 'user_id' => $userId)) + ->setMax($max) + ->setOrder(TaskModel::TABLE.'.project_id, '.TaskModel::TABLE.'.id') + ->setQuery($query) + ->setFormatter($this->taskListProjectFormatter) + ->calculateOnlyIf($this->request->getStringParam('pagination') === 'tasks'); + } + } -- cgit v1.2.3