private function getKanbanTitle()
 {
     $old_kanban_title = $this->config_manager->getKanbanTitle($this->project_id);
     $kanban_title = trim($this->request->get('kanban-title-admin'));
     if ($kanban_title !== $old_kanban_title) {
         $this->response->kanbanTitleChanged();
     }
     if ($kanban_title == '') {
         $this->response->emptyKanbanTitle();
         $kanban_title = $old_kanban_title;
     }
     return $kanban_title;
 }
Пример #2
0
 private function showHome()
 {
     $user = $this->request->getCurrentUser();
     $plannings = $this->planning_factory->getNonLastLevelPlannings($user, $this->group_id);
     $last_plannings = $this->planning_factory->getLastLevelPlannings($user, $this->group_id);
     $kanban_is_activated = $this->config_manager->kanbanIsActivatedForProject($this->group_id);
     $scrum_is_configured = !empty($plannings) || !empty($last_plannings);
     if (!$scrum_is_configured && !$kanban_is_activated) {
         return $this->showEmptyHome();
     }
     $presenter = new Planning_Presenter_HomePresenter($this->getMilestoneAccessPresenters($plannings), $this->group_id, $this->getLastLevelMilestonesPresenters($last_plannings, $user), $this->request->get('period'), $this->getProjectFromRequest()->getPublicName(), $kanban_is_activated, $user, $this->kanban_manager->getTrackersWithKanbanUsageAndHierarchy($this->group_id, $user), $this->getKanbanSummaryPresenters(), $this->config_manager->scrumIsActivatedForProject($this->group_id), $scrum_is_configured, $this->config_manager->getScrumTitle($this->group_id), $this->config_manager->getKanbanTitle($this->group_id), $this->isUserADmin());
     return $this->renderToString('home', $presenter);
 }
 private function getScrumTitle()
 {
     $old_scrum_title = $this->config_manager->getScrumTitle($this->project_id);
     $scrum_title = trim($this->request->get('scrum-title-admin'));
     if ($scrum_title !== $old_scrum_title) {
         $this->response->scrumTitleChanged();
     }
     if ($scrum_title == '') {
         $this->response->emptyScrumTitle();
         $scrum_title = $old_scrum_title;
     }
     return $scrum_title;
 }
 public function updateConfiguration()
 {
     $this->checkIfRequestIsValid();
     if (!$this->request->getCurrentUser()->isAdmin($this->group_id)) {
         $GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'perm_denied'));
         return;
     }
     switch ($this->request->get('activate-ad-component')) {
         case 'activate-scrum':
             $GLOBALS['Response']->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('plugin_agiledashboard', 'scrum_activated'));
             $scrum_is_activated = 1;
             $kanban_is_activated = 0;
             break;
         case 'activate-kanban':
             $GLOBALS['Response']->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('plugin_agiledashboard', 'kanban_activated'));
             $scrum_is_activated = 0;
             $kanban_is_activated = 1;
             break;
         case 'activate-all':
             $GLOBALS['Response']->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('plugin_agiledashboard', 'all_activated'));
             $scrum_is_activated = 1;
             $kanban_is_activated = 1;
             break;
         default:
             $this->notifyErrorAndRedirectToAdmin();
             return;
     }
     $this->config_manager->updateConfiguration($this->group_id, $scrum_is_activated, $kanban_is_activated, $this->getScrumTitle(), $this->getKanbanTitle());
     $this->redirectToAdmin();
 }
 private function getAdminKanbanPresenter(PFUser $user, $project_id)
 {
     $has_kanban = count($this->kanban_factory->getListOfKanbansForProject($user, $project_id)) > 0;
     return new AdminKanbanPresenter($project_id, $this->config_manager->kanbanIsActivatedForProject($project_id), $this->config_manager->getKanbanTitle($project_id), $has_kanban);
 }