public function getMilestoneRepresentation(Planning_Milestone $milestone, PFUser $user) { $milestone_representation = new MilestoneRepresentation(); $milestone_representation->build($milestone, $this->milestone_factory->getMilestoneStatusCount($user, $milestone), $this->getBacklogTrackers($milestone), $this->milestone_factory->userCanChangePrioritiesInMilestone($milestone, $user)); $this->event_manager->processEvent(AGILEDASHBOARD_EVENT_REST_GET_MILESTONE, array('version' => 'v1', 'user' => $user, 'milestone' => $milestone, 'milestone_representation' => &$milestone_representation)); return $milestone_representation; }
/** * We display an effort based progress bar if and only if all backlog elements * have an initial effort. Otherwise, you might ends with a progress bar at * 100% done with cards "not done". * * @return Cardwall_EffortProgressPresenter */ private function getProgressPresenter() { try { return new Cardwall_RemainingEffortProgressPresenter($this->getInitialEffort(), $this->milestone->getCapacity(), $this->milestone->getRemainingEffort()); } catch (InitialEffortNotDefinedException $exception) { $status_count = $this->milestone_factory->getMilestoneStatusCount($this->user, $this->milestone); return new Cardwall_OpenClosedEffortProgressPresenter($status_count[Tracker_Artifact::STATUS_OPEN], $status_count[Tracker_Artifact::STATUS_CLOSED]); } }
/** * @return Planning_Presenter_MilestoneSummaryPresenter[] */ private function getMilestoneSummaryPresenters(Planning $last_planning, PFUser $user) { $presenters = array(); $has_cardwall = $this->hasCardwall($last_planning); $last_planning_current_milestones = $this->getPlanningMilestonesDependingOnTimePeriodOrStatus($last_planning); if (empty($last_planning_current_milestones)) { return $presenters; } foreach ($last_planning_current_milestones as $milestone) { $this->milestone_factory->addMilestoneAncestors($user, $milestone); $milestone = $this->milestone_factory->updateMilestoneContextualInfo($user, $milestone); if ($milestone->hasUsableBurndownField()) { $burndown_data = $milestone->getBurndownData($user); $presenters[] = new Planning_Presenter_MilestoneBurndownSummaryPresenter($milestone, $this->plugin_path, $has_cardwall, $burndown_data); } else { $presenters[] = new Planning_Presenter_MilestoneSummaryPresenter($milestone, $this->plugin_path, $has_cardwall, $this->milestone_factory->getMilestoneStatusCount($user, $milestone)); } } return $presenters; }