From ff892c5d25e0bab560f005c788189d38c2bcab7b Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 25 May 2016 22:28:09 -0400 Subject: Split project controller into multiple classes --- app/Controller/ProjectListController.php | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/Controller/ProjectListController.php (limited to 'app/Controller/ProjectListController.php') diff --git a/app/Controller/ProjectListController.php b/app/Controller/ProjectListController.php new file mode 100644 index 00000000..5571b3c9 --- /dev/null +++ b/app/Controller/ProjectListController.php @@ -0,0 +1,41 @@ +userSession->isAdmin()) { + $project_ids = $this->project->getAllIds(); + } else { + $project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId()); + } + + $nb_projects = count($project_ids); + + $paginator = $this->paginator + ->setUrl('ProjectListController', 'show') + ->setMax(20) + ->setOrder('name') + ->setQuery($this->project->getQueryColumnStats($project_ids)) + ->calculate(); + + $this->response->html($this->helper->layout->app('project_list/show', array( + 'paginator' => $paginator, + 'nb_projects' => $nb_projects, + 'title' => t('Projects').' ('.$nb_projects.')' + ))); + } +} -- cgit v1.2.3