/**
  * Get all mappings defined for the cardwall on top of a tracker
  *
  * @param Tracker $tracker The tracker
  * @param array   $columns array of Cardwall_Column
  *
  * @return array of Cardwall_OnTop_Config_TrackerMapping
  */
 public function getMappings(Tracker $tracker, Cardwall_OnTop_Config_ColumnCollection $columns)
 {
     $mappings = array();
     foreach ($this->dao->searchMappingFields($tracker->getId()) as $row) {
         $this->instantiateMappingFromRow($tracker, $mappings, $row, $columns);
     }
     return $mappings;
 }
 /**
  * @see Cardwall_OnTop_Config_Command::execute()
  */
 public function execute(Codendi_Request $request)
 {
     if ($request->get('add_mapping_on')) {
         $new_mapping_tracker = $this->tracker_factory->getTrackerById($request->get('add_mapping_on'));
         if ($new_mapping_tracker && $this->dao->create($this->tracker->getId(), $new_mapping_tracker->getId(), null)) {
             $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_mapping_added', array($new_mapping_tracker->getName())));
         }
     }
 }
 private function saveFieldMapping(Tracker $mapping_tracker, Tracker_FormElement $field)
 {
     if ($this->dao->save($this->tracker->getId(), $mapping_tracker->getId(), $field->getId())) {
         $this->value_dao->delete($this->tracker->getId(), $mapping_tracker->getId());
         $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_mapping_changed', array($mapping_tracker->getName(), $field->getLabel())));
     }
 }
Example #4
0
 /**
  * @see Cardwall_OnTop_Config_Command::execute()
  */
 public function execute(Codendi_Request $request)
 {
     if ($request->get('column')) {
         $deleted_columns = 0;
         foreach ($request->get('column') as $id => $column_definition) {
             if (empty($column_definition['label'])) {
                 $this->value_dao->deleteForColumn($this->tracker->getId(), $id);
                 $this->dao->delete($this->tracker->getId(), $id);
                 $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_column_removed'));
                 $deleted_columns++;
             }
         }
         if (count($request->get('column')) === $deleted_columns) {
             $this->field_dao->deleteCardwall($this->tracker->getId());
         }
     }
 }
 private function delete(Tracker $mapping_tracker)
 {
     return $this->dao->delete($this->tracker->getId(), $mapping_tracker->getId()) && $this->value_dao->delete($this->tracker->getId(), $mapping_tracker->getId());
 }