public function loadFixtures(TBGScope $scope) { foreach (TBGIssueTypesTable::getTable()->getAllIDsByScopeID($scope->getID()) as $issuetype_id) { $crit = $this->getCriteria(); $crit->addInsert(self::SCOPE, $scope->getID()); $crit->addInsert(self::WORKFLOW_ID, TBGSettings::getCoreWorkflow()->getID()); $crit->addInsert(self::WORKFLOW_SCHEME_ID, TBGSettings::getCoreWorkflowScheme()->getID()); $crit->addInsert(self::ISSUETYPE_ID, $issuetype_id); $this->doInsert($crit); } }
/** * Whether this is the builtin workflow that cannot be * edited or removed * * @return boolean */ public function isCore() { return $this->getID() == TBGSettings::getCoreWorkflowScheme()->getID(); }
echo __('Additional settings'); ?> </div> <label class="optional" for="add_project_workflow_scheme"><?php echo __('Workflow scheme'); ?> </label> <select name="workflow_scheme_id" id="add_project_workflow_scheme"> <?php foreach (TBGWorkflowScheme::getAll() as $workflowscheme) { ?> <option value="<?php echo $workflowscheme->getID(); ?> " <?php if (TBGSettings::getCoreWorkflowScheme()->getID() == $workflowscheme->getID()) { echo ' selected'; } ?> ><?php echo $workflowscheme->getName(); ?> </option> <?php } ?> </select><br> <label class="optional" for="add_project_issuetype_scheme"><?php echo __('Issue type scheme'); ?> </label>
/** * Pre save check for conflicting keys * * @param boolean $is_new */ protected function _preSave($is_new) { parent::_preSave($is_new); $project = self::getByKey($this->getKey()); if ($project instanceof TBGProject && $project->getID() != $this->getID()) { throw new InvalidArgumentException("A project with this key already exists"); } if ($is_new) { if (!$this->_issuetype_scheme_id) { $this->setIssuetypeScheme(TBGSettings::getCoreIssuetypeScheme()); } if (!$this->_workflow_scheme_id) { $this->setWorkflowScheme(TBGSettings::getCoreWorkflowScheme()); } } }