Improve dashboard
This commit is contained in:
35
app/Pagination/SubtaskPagination.php
Normal file
35
app/Pagination/SubtaskPagination.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Pagination;
|
||||
|
||||
use Kanboard\Core\Base;
|
||||
use Kanboard\Core\Paginator;
|
||||
use Kanboard\Model\TaskModel;
|
||||
|
||||
/**
|
||||
* Class SubtaskPagination
|
||||
*
|
||||
* @package Kanboard\Pagination
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class SubtaskPagination extends Base
|
||||
{
|
||||
/**
|
||||
* Get dashboard pagination
|
||||
*
|
||||
* @access public
|
||||
* @param integer $userId
|
||||
* @return Paginator
|
||||
*/
|
||||
public function getDashboardPaginator($userId)
|
||||
{
|
||||
return $this->paginator
|
||||
->setUrl('DashboardController', 'subtasks', array('user_id' => $userId))
|
||||
->setMax(50)
|
||||
->setOrder(TaskModel::TABLE.'.priority')
|
||||
->setDirection('DESC')
|
||||
->setFormatter($this->taskListSubtaskAssigneeFormatter->withUserId($userId)->withoutEmptyTasks())
|
||||
->setQuery($this->taskFinderModel->getUserQuery($userId))
|
||||
->calculate();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user