From a43f71dda953ab1ca130af875b221569e4767f05 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 19 Feb 2017 18:27:57 -0500 Subject: Redesign project list view --- app/Controller/ProjectListController.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'app/Controller') 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() . ')', ))); } } -- cgit v1.2.3