diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-02-19 18:27:57 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-02-19 18:27:57 -0500 |
commit | a43f71dda953ab1ca130af875b221569e4767f05 (patch) | |
tree | 33d6f7e650110bbdc5e7bf415b3f5da7735e74d6 /app/Controller | |
parent | b5c56d4239c1f4e5c1b7894803c899b595797a26 (diff) |
Redesign project list view
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/ProjectListController.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/app/Controller/ProjectListController.php b/app/Controller/ProjectListController.php index 4de73c97..95ff5d91 100644 --- a/app/Controller/ProjectListController.php +++ b/app/Controller/ProjectListController.php @@ -18,24 +18,21 @@ class ProjectListController extends BaseController public function show() { if ($this->userSession->isAdmin()) { - $project_ids = $this->projectModel->getAllIds(); + $projectIds = $this->projectModel->getAllIds(); } else { - $project_ids = $this->projectPermissionModel->getProjectIds($this->userSession->getId()); + $projectIds = $this->projectPermissionModel->getProjectIds($this->userSession->getId()); } - $nb_projects = count($project_ids); - $paginator = $this->paginator ->setUrl('ProjectListController', 'show') ->setMax(20) ->setOrder('name') - ->setQuery($this->projectModel->getQueryColumnStats($project_ids)) + ->setQuery($this->projectModel->getQueryByProjectIds($projectIds)) ->calculate(); - $this->response->html($this->helper->layout->app('project_list/show', array( - 'paginator' => $paginator, - 'nb_projects' => $nb_projects, - 'title' => t('Projects').' ('.$nb_projects.')' + $this->response->html($this->helper->layout->app('project_list/listing', array( + 'paginator' => $paginator, + 'title' => t('Projects') . ' (' . $paginator->getTotal() . ')', ))); } } |