summaryrefslogtreecommitdiff
path: root/app/Pagination/SubtaskPagination.php
diff options
context:
space:
mode:
authorChristopher Geelen <christopher.geelen@vinotion.nl>2016-07-27 13:58:23 +0200
committerChristopher Geelen <christopher.geelen@vinotion.nl>2016-07-27 13:58:23 +0200
commit24745182724ca69092554eb5946e31584420f68a (patch)
tree386cdf7a8d7bf7ad2d80d938333bafbaf0fedcbc /app/Pagination/SubtaskPagination.php
parent160c0b885eb4f1a1a1baa2b6b9fc6d99fdb80d0c (diff)
parent9649f7ba82ba7fe6a470abfe9f65e214cc68fa34 (diff)
Merge remote-tracking branch 'upstream/master'
Conflicts: app/Job/NotificationJob.php
Diffstat (limited to 'app/Pagination/SubtaskPagination.php')
-rw-r--r--app/Pagination/SubtaskPagination.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/Pagination/SubtaskPagination.php b/app/Pagination/SubtaskPagination.php
new file mode 100644
index 00000000..f0cd6148
--- /dev/null
+++ b/app/Pagination/SubtaskPagination.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Kanboard\Pagination;
+
+use Kanboard\Core\Base;
+use Kanboard\Core\Paginator;
+use Kanboard\Model\SubtaskModel;
+use Kanboard\Model\TaskModel;
+
+/**
+ * Class SubtaskPagination
+ *
+ * @package Kanboard\Pagination
+ * @author Frederic Guillot
+ */
+class SubtaskPagination extends Base
+{
+ /**
+ * Get dashboard pagination
+ *
+ * @access public
+ * @param integer $user_id
+ * @param string $method
+ * @param integer $max
+ * @return Paginator
+ */
+ public function getDashboardPaginator($user_id, $method, $max)
+ {
+ return $this->paginator
+ ->setUrl('DashboardController', $method, array('pagination' => 'subtasks', 'user_id' => $user_id))
+ ->setMax($max)
+ ->setOrder(TaskModel::TABLE.'.id')
+ ->setQuery($this->subtaskModel->getUserQuery($user_id, array(SubtaskModel::STATUS_TODO, SubtaskModel::STATUS_INPROGRESS)))
+ ->calculateOnlyIf($this->request->getStringParam('pagination') === 'subtasks');
+ }
+}