/**
  * @return string The URL to the planning view of this milestone.
  */
 public function getUri()
 {
     $group_id = $this->milestone->getGroupId();
     $planning_id = $this->milestone->getPlanningId();
     $artifact_id = $this->milestone->getArtifactId();
     return "/plugins/agiledashboard/?group_id={$group_id}&action=show&planning_id={$planning_id}&aid={$artifact_id}";
 }
Пример #2
0
 private function loadTopBacklog(PFUser $user, Planning_Milestone $milestone)
 {
     if (!isset($this->backlog_item_ids[(int) $milestone->getArtifactId()])) {
         $this->backlog_item_ids[(int) $milestone->getArtifactId()] = array();
         $strategy_unassigned = $this->strategy_factory->getSelfBacklogStrategy($milestone);
         $backlog_artifacts = $this->backlog_item_collection_factory->getUnassignedOpenCollection($user, $milestone, $strategy_unassigned, false);
         $this->storeTopBacklogArtifacts((int) $milestone->getArtifactId(), $backlog_artifacts);
     }
 }
Пример #3
0
 /**
  * @return Cardwall_PaneContentPresenter
  */
 private function getPresenterUsingMappedFields(Cardwall_OnTop_Config_ColumnCollection $columns)
 {
     $board_factory = new Cardwall_BoardFactory();
     $planned_artifacts = $this->milestone->getPlannedArtifacts();
     $field_retriever = new Cardwall_OnTop_Config_MappedFieldProvider($this->config, new Cardwall_FieldProviders_SemanticStatusFieldRetriever());
     $board = $board_factory->getBoard($field_retriever, $columns, $planned_artifacts, $this->config);
     $backlog_title = $this->milestone->getPlanning()->getBacklogTracker()->getName();
     $redirect_parameter = 'cardwall[agile][' . $this->milestone->getPlanning()->getId() . ']=' . $this->milestone->getArtifactId();
     $configure_url = TRACKER_BASE_URL . '/?tracker=' . $this->milestone->getTrackerId() . '&func=admin-cardwall';
     return new Cardwall_PaneContentPresenter($board, $this->getQrCode(), $redirect_parameter, $backlog_title, $configure_url);
 }
 private function getMatchingIdsForMilestone(Planning_Milestone $milestone, Tracker $backlog_tracker)
 {
     $milestone_id_seed = array($milestone->getArtifactId());
     $this->inspected_ids = $milestone_id_seed;
     $this->filterBacklogIds($backlog_tracker->getId(), $milestone_id_seed);
     return $this->backlog_ids;
 }
 public function __construct(\Planning_Milestone $milestone)
 {
     $this->id = JsonCast::toInt($milestone->getArtifactId());
     $this->label = $milestone->getArtifactTitle();
     $this->last_modified = JsonCast::toDate($milestone->getLastModifiedDate());
     $this->uri = self::ROUTE . '/' . $this->id;
 }
Пример #6
0
 public function itMayBeNull()
 {
     $this->milestone = new Planning_NoMilestone($this->project, $this->planning);
     $this->assertNull($this->milestone->getArtifact());
     $this->assertNull($this->milestone->getArtifactId());
     $this->assertNull($this->milestone->getArtifactTitle());
     $this->assertTrue($this->milestone->userCanView(mock('User')), "any user should be able to read an empty milstone");
 }
 public function __construct(AgileDashboard_BacklogItemDao $item_dao, Tracker_ArtifactDao $artifact_dao, Tracker_ArtifactFactory $artifact_factory, Planning_Milestone $milestone, array $descendant_tracker_ids)
 {
     $this->item_dao = $item_dao;
     $this->artifact_dao = $artifact_dao;
     $this->artifact_factory = $artifact_factory;
     $this->milestone = $milestone;
     $this->milestone_id = $milestone->getArtifactId();
     $this->descendant_tracker_ids = $descendant_tracker_ids;
     $this->backlog_tracker_ids = $milestone->getPlanning()->getBacklogTrackersIds();
 }
Пример #8
0
 /**
  * @return array of (id, title, selected)
  */
 public function selectableArtifacts()
 {
     $hp = Codendi_HTMLPurifier::instance();
     $artifacts_data = array();
     $selected_id = $this->milestone->getArtifactId();
     foreach ($this->available_milestones as $milestone) {
         $artifacts_data[] = array('id' => $milestone->getArtifactId(), 'title' => $hp->purify($milestone->getArtifactTitle()), 'selected' => $milestone->getArtifactId() == $selected_id ? 'selected="selected"' : '');
     }
     return $artifacts_data;
 }
 public function __construct(Planning_Milestone $milestone, $redirect_to_self, PFUser $user, array $quick_link_collection)
 {
     $this->id = $milestone->getArtifactId();
     $this->planning_id = $milestone->getPlanningId();
     $this->milestone_title = $milestone->getArtifact()->getTitle();
     $this->milestone_start_date = $milestone->getStartDate();
     $this->milestone_end_date = $milestone->getEndDate();
     $this->milestone_status = $milestone->getArtifact()->getStatus();
     $this->edit_submilestone_url = $milestone->getArtifact()->getUri();
     $this->redirect_to_self = $redirect_to_self;
     $this->milestone_capacity = $milestone->getCapacity();
     $this->quick_link_collection = $quick_link_collection;
 }
Пример #10
0
 private function getSwitchDisplayAvatarsURL()
 {
     if ($this->user->isAnonymous()) {
         return false;
     }
     $group_id = $this->milestone->getGroupId();
     $planning_id = $this->milestone->getPlanningId();
     $tracker_id = $this->milestone->getTrackerId();
     $artifact_id = $this->milestone->getArtifactId();
     $action = 'toggle_user_display_avatar';
     $switch_display_username_url = CARDWALL_BASE_URL . '/?group_id=' . $group_id . '&planning_id=' . $planning_id . '&tracker_id=' . $tracker_id . '&aid=' . $artifact_id . '&action=' . $action;
     return $switch_display_username_url;
 }
Пример #11
0
 public function __construct(AgileDashboard_Milestone_Backlog_BacklogItemPresenterCollection $backlog_collection, AgileDashboard_Milestone_Pane_Planning_PlanningSubMilestonePresenterCollection $submilestone_collection, Planning_Milestone $milestone, $parent_item_type, $submilestone_item_type, $add_new_submilestone_url, $can_add_submilestone, $can_plan, $redirect_to_self, array $trackers_without_initial_effort)
 {
     $this->backlog_collection = $backlog_collection;
     $this->submilestone_collection = $submilestone_collection;
     $this->parent_item_type = $parent_item_type;
     $this->submilestone_item_type = $submilestone_item_type;
     $this->add_new_submilestone_url = $add_new_submilestone_url;
     $this->can_add_submilestone = $can_add_submilestone;
     $this->can_plan = $can_plan;
     $this->redirect_to_self = $redirect_to_self;
     $this->milestone_id = $milestone->getArtifactId();
     $this->milestone_planning_id = $milestone->getPlanningId();
     $this->milestone_item_type = $milestone->getArtifactTitle();
     foreach ($trackers_without_initial_effort as $tracker_without_initial_effort) {
         $this->trackers_without_initial_effort_field[] = $tracker_without_initial_effort->getName();
     }
 }
Пример #12
0
 /**
  * Returns a status array. E.g.
  *  array(
  *      Tracker_Artifact::STATUS_OPEN   => no_of_opne,
  *      Tracker_Artifact::STATUS_CLOSED => no_of_closed,
  *  )
  *
  * @return array
  */
 public function getMilestoneStatusCount(PFUser $user, Planning_Milestone $milestone)
 {
     return $this->status_counter->getStatus($user, $milestone->getArtifactId());
 }
 private function initInconsistentItems(PFUser $user, Planning_Milestone $milestone, $redirect_to_self, array $planned)
 {
     foreach ($planned as $planned_artifact_id) {
         if (!$this->all_collection[$milestone->getArtifactId()]->containsId($planned_artifact_id)) {
             $artifact = $this->artifact_factory->getArtifactByIdUserCanView($user, $planned_artifact_id);
             if ($artifact) {
                 $this->inconsistent_collection[$milestone->getArtifactId()]->push($this->backlog_item_builder->getItem($artifact, $redirect_to_self));
             }
         }
     }
 }
 /** @return string */
 public function getPlanningRedirectToSelf(Planning_Milestone $milestone, $pane_identifier)
 {
     $planning_id = (int) $milestone->getPlanningId();
     $artifact_id = $milestone->getArtifactId();
     return "planning[{$pane_identifier}][{$planning_id}]={$artifact_id}";
 }
Пример #15
0
 protected function getUriParametersForMilestone(Planning_Milestone $milestone)
 {
     return array('group_id' => $milestone->getGroupId(), 'planning_id' => $milestone->getPlanningId(), 'action' => $this->action, 'aid' => $milestone->getArtifactId(), 'pane' => $this->getIdentifier());
 }
 public function artifact_id()
 {
     return $this->milestone->getArtifactId();
 }
 public function milestone_edit_url()
 {
     return '/plugins/tracker/?aid=' . $this->milestone->getArtifactId();
 }
 private function buildAdditionnalPanes(Planning_Milestone $milestone)
 {
     if ($milestone->getArtifact()) {
         EventManager::instance()->processEvent(AGILEDASHBOARD_EVENT_ADDITIONAL_PANES_ON_MILESTONE, array('milestone' => $milestone, 'request' => $this->request, 'user' => $this->request->getCurrentUser(), 'panes' => &$this->list_of_pane_info[$milestone->getArtifactId()], 'active_pane' => &$this->active_pane[$milestone->getArtifactId()], 'milestone_factory' => $this->milestone_factory));
     }
 }
Пример #19
0
 private function getPlanningRedirectToNew()
 {
     $planning_id = (int) $this->milestone->getPlanningId();
     $artifact_id = $this->milestone->getArtifactId();
     return "planning[{$planning_id}]=-1";
 }