summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoRex <dev@corex.dk>2017-12-02 01:00:57 +0100
committerfguillot <fred@kanboard.net>2017-12-04 10:35:53 -0800
commitd5145925a0a284ba7a7556a7629932b9fc71c68f (patch)
tree55c2142623280c1c012512825926eedb198eb076
parent7da4c943b86fcd56bc7f5940ce0753539d3432df (diff)
Added 'pagination:dashboard:project:query' to ProjectPagination.
-rw-r--r--app/Pagination/ProjectPagination.php5
-rw-r--r--doc/en_US/plugin-hooks.markdown1
2 files changed, 5 insertions, 1 deletions
diff --git a/app/Pagination/ProjectPagination.php b/app/Pagination/ProjectPagination.php
index 8f1fa87c..563998f2 100644
--- a/app/Pagination/ProjectPagination.php
+++ b/app/Pagination/ProjectPagination.php
@@ -25,11 +25,14 @@ class ProjectPagination extends Base
*/
public function getDashboardPaginator($user_id, $method, $max)
{
+ $query = $this->projectModel->getQueryColumnStats($this->projectPermissionModel->getActiveProjectIds($user_id));
+ $this->hook->reference('pagination:dashboard:project:query', $query);
+
return $this->paginator
->setUrl('DashboardController', $method, array('pagination' => 'projects', 'user_id' => $user_id))
->setMax($max)
->setOrder(ProjectModel::TABLE.'.name')
- ->setQuery($this->projectModel->getQueryColumnStats($this->projectPermissionModel->getActiveProjectIds($user_id)))
+ ->setQuery($query)
->calculateOnlyIf($this->request->getStringParam('pagination') === 'projects');
}
}
diff --git a/doc/en_US/plugin-hooks.markdown b/doc/en_US/plugin-hooks.markdown
index c37cf80b..54b9f689 100644
--- a/doc/en_US/plugin-hooks.markdown
+++ b/doc/en_US/plugin-hooks.markdown
@@ -136,6 +136,7 @@ List of reference hooks:
| Hook | Description |
|--------------------------------------------|---------------------------------------------------------------|
| `formatter:board:query` | Alter database query before rendering board |
+| `pagination:dashboard:project:query` | Alter database query for projects pagination on the dashboard |
| `pagination:dashboard:task:query` | Alter database query for tasks pagination on the dashboard |
| `pagination:dashboard:subtask:query` | Alter database query for subtasks pagination on the dashboard |
| `model:task:creation:prepare` | Alter form values before to save a task |