private function getMappingCollection(Planning $planning, Cardwall_OnTop_Config_ColumnCollection $columns, Cardwall_FieldProviders_IProvideFieldGivenAnArtifact $field_provider, Cardwall_OnTop_Config $config)
 {
     $trackers_used_on_cardwall = array();
     foreach ($planning->getBacklogTrackers() as $backlog_tracker) {
         $trackers_used_on_cardwall[] = $backlog_tracker->getChildren();
     }
     return $config->getCardwallMappings($this->getIndexedStatusFieldsOf($trackers_used_on_cardwall, $field_provider), $columns);
 }
Example #2
0
 /**
  * @return Cardwall_Board
  */
 public function getBoard(Cardwall_FieldProviders_IProvideFieldGivenAnArtifact $field_retriever, Cardwall_OnTop_Config_ColumnCollection $columns, TreeNode $forests_of_artifacts, Cardwall_OnTop_Config $config, User $user)
 {
     $acc_field_provider = new Cardwall_FieldsExtractor($field_retriever);
     $status_fields = $acc_field_provider->extractAndIndexFieldsOf($forests_of_artifacts);
     $mapping_collection = $config->getCardwallMappings($status_fields, $columns);
     $forests_of_cardincell_presenters = $this->transformIntoForestOfCardInCellPresenters($forests_of_artifacts, $field_retriever, $mapping_collection, $user);
     $swimlines = $this->getSwimlines($columns, $forests_of_cardincell_presenters, $config, $field_retriever);
     return new Cardwall_Board($swimlines, $columns, $mapping_collection);
 }
 /**
  * @return Cardwall_RendererPresenter
  */
 private function getPresenter(array $artifact_ids, PFUser $user, $form = null)
 {
     $redirect_parameter = 'cardwall[renderer][' . $this->report->id . ']=' . $this->id;
     $field = $this->getField();
     if (!$field) {
         $board = new Cardwall_Board(array(), new Cardwall_OnTop_Config_ColumnCollection(), new Cardwall_MappingCollection());
     } else {
         $field_provider = new Cardwall_FieldProviders_CustomFieldRetriever($field);
         $column_preferences = new Cardwall_UserPreferences_Autostack_AutostackRenderer($user, $this->report);
         $columns = $this->config->getRendererColumns($field, $column_preferences);
         $column_autostack = new Cardwall_UserPreferences_UserPreferencesAutostackFactory();
         $column_autostack->setAutostack($columns, $column_preferences);
         $display_preferences = new Cardwall_UserPreferences_UserPreferencesDisplayUser(Cardwall_UserPreferences_UserPreferencesDisplayUser::DISPLAY_AVATARS);
         $mapping_collection = $this->config->getCardwallMappings(array($field->getId() => $field), $columns);
         $presenter_builder = new Cardwall_CardInCellPresenterBuilder(new Cardwall_CardInCellPresenterFactory($field_provider, $mapping_collection), new Cardwall_CardFields(UserManager::instance(), Tracker_FormElementFactory::instance()), $display_preferences, $user);
         $swimline_factory = new Cardwall_SwimlineFactory($this->config, $field_provider);
         $board_builder = new Cardwall_RendererBoardBuilder($presenter_builder, Tracker_ArtifactFactory::instance(), $swimline_factory);
         $board = $board_builder->getBoard($artifact_ids, $columns, $mapping_collection);
     }
     return new Cardwall_RendererPresenter($board, $this->getQrCode(), $redirect_parameter, $field, $form);
 }
 private function getCardInCellPresenterFactory(Cardwall_OnTop_Config $config, Tracker_Artifact $artifact, Cardwall_FieldProviders_IProvideFieldGivenAnArtifact $field_provider, Cardwall_OnTop_Config_ColumnCollection $columns)
 {
     $field = $field_provider->getField($artifact->getTracker());
     $status_fields[$field->getId()] = $field;
     return new Cardwall_CardInCellPresenterFactory($field_provider, $config->getCardwallMappings($status_fields, $columns));
 }