diff options
author | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2020-04-08 14:01:28 +0200 |
---|---|---|
committer | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2020-04-08 14:01:28 +0200 |
commit | 0dfe48b7fa475aade00a8ccf42e3dba99dfa3702 (patch) | |
tree | 92d34a659a841c4d0036fa5ef23b2f2b425c4b4e /app/Pagination/TaskPagination.php | |
parent | eca069dbd1318274b4170eb78629b0128dd0543c (diff) |
"My tasks" view grops tasks by project - fixes #107
Diffstat (limited to 'app/Pagination/TaskPagination.php')
-rw-r--r-- | app/Pagination/TaskPagination.php | 15 |
1 files changed, 15 insertions, 0 deletions
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'); + } + } |