/** * @see Cardwall_OnTop_Config_Command::execute() */ public function execute(Codendi_Request $request) { if ($request->get('new_column')) { $this->dao->create($this->tracker->getId(), $request->get('new_column')); $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_column_added')); } }
/** * @return Cardwall_OnTop_Config_ColumnCollection */ private function getColumnsFromDao(Tracker $tracker) { $columns = new Cardwall_OnTop_Config_ColumnFreestyleCollection(); foreach ($this->dao->searchColumnsByTrackerId($tracker->getId()) as $row) { list($bgcolor, $fgcolor) = $this->getColumnColorsFromRow($row); $columns[] = new Cardwall_Column($row['id'], $row['label'], $bgcolor, $fgcolor); } return $columns; }
/** * @see Cardwall_OnTop_Config_Command::execute() */ public function execute(Codendi_Request $request) { if ($request->get('column')) { foreach ($request->get('column') as $id => $column_definition) { $column_label = $column_definition['label']; if (!empty($column_label) && $this->dao->save($this->tracker->getId(), $id, $column_label)) { $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_column_changed', array($column_label))); } } } }
/** * @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()); } } }
/** * @see Cardwall_OnTop_Config_Command::execute() */ public function execute(Codendi_Request $request) { if ($request->get('column')) { foreach ($request->get('column') as $id => $column_definition) { $column_label = $column_definition['label']; $column_bg_red = 255; $column_bg_green = 255; $column_bg_blue = 255; if (!empty($column_definition['bgcolor'])) { list($column_bg_red, $column_bg_green, $column_bg_blue) = ColorHelper::HexatoRGB($column_definition['bgcolor']); } if (!empty($column_label) && $this->dao->save($this->tracker->getId(), $id, $column_label, $column_bg_red, $column_bg_green, $column_bg_blue)) { $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_column_changed', array($column_label))); } } } }
private function importColumns(SimpleXMLElement $xml_columns, $tracker_id) { foreach ($xml_columns->{CardwallConfigXml::NODE_COLUMN} as $column) { $this->column_dao->create($tracker_id, (string) $column[CardwallConfigXml::ATTRIBUTE_COLUMN_LABEL]); } }