public static function loadFixtures(TBGScope $scope) { $scope_id = $scope->getID(); $bug_report = new TBGIssuetype(); $bug_report->setName('Bug report'); $bug_report->setIcon('bug_report'); $bug_report->setDescription('Have you discovered a bug in the application, or is something not working as expected?'); $bug_report->save(); TBGSettings::saveSetting('defaultissuetypefornewissues', $bug_report->getID(), 'core', $scope_id); TBGSettings::saveSetting('issuetype_bug_report', $bug_report->getID(), 'core', $scope_id); $feature_request = new TBGIssuetype(); $feature_request->setName('Feature request'); $feature_request->setIcon('feature_request'); $feature_request->setDescription('Are you missing some specific feature, or is your favourite part of the application a bit lacking?'); $feature_request->save(); TBGSettings::saveSetting('issuetype_feature_request', $feature_request->getID(), 'core', $scope_id); $enhancement = new TBGIssuetype(); $enhancement->setName('Enhancement'); $enhancement->setIcon('enhancement'); $enhancement->setDescription('Have you found something that is working in a way that could be improved?'); $enhancement->save(); TBGSettings::saveSetting('issuetype_enhancement', $enhancement->getID(), 'core', $scope_id); $task = new TBGIssuetype(); $task->setName('Task'); $task->setIcon('task'); $task->setIsTask(); $task->save(); TBGSettings::saveSetting('issuetype_task', $task->getID(), 'core', $scope_id); $user_story = new TBGIssuetype(); $user_story->setName('User story'); $user_story->setIcon('developer_report'); $user_story->setDescription('Doing it Agile-style. Issue type perfectly suited for entering user stories'); $user_story->save(); TBGSettings::saveSetting('issuetype_user_story', $user_story->getID(), 'core', $scope_id); $idea = new TBGIssuetype(); $idea->setName('Idea'); $idea->setIcon('idea'); $idea->setDescription('Express yourself - share your ideas with the rest of the team!'); $idea->save(); TBGSettings::saveSetting('issuetype_idea', $idea->getID(), 'core', $scope_id); return array($bug_report->getID(), $feature_request->getID(), $enhancement->getID(), $task->getID(), $user_story->getID(), $idea->getID()); }
/** * Move issues from one step to another for a given issue type and conversions * @param TBGProject $project * @param TBGIssuetype $type * @param array $conversions * * $conversions should be an array containing arrays: * array ( * array(oldstep, newstep) * ... * ) */ public function convertIssueStepByIssuetype(TBGProject $project, TBGIssuetype $type, array $conversions) { foreach ($conversions as $conversion) { $crit = $this->getCriteria(); $crit->addWhere(self::PROJECT_ID, $project->getID()); $crit->addWhere(self::ISSUE_TYPE, $type->getID()); $crit->addWhere(self::WORKFLOW_STEP_ID, $conversion[0]); $crit->addUpdate(self::WORKFLOW_STEP_ID, $conversion[1]); $this->doUpdate($crit); } }
public function setFieldAvailableForIssuetype(TBGIssuetype $issuetype, $key, $details = array()) { TBGIssueFieldsTable::getTable()->addFieldAndDetailsBySchemeIDandIssuetypeID($this->getID(), $issuetype->getID(), $key, $details); }
/** * Get all steps in this workflow * * @return array An array of TBGWorkflowStep objects */ public function getWorkflowForIssuetype(TBGIssuetype $issuetype) { $this->_populateAssociatedWorkflows(); if (array_key_exists($issuetype->getID(), $this->_issuetype_workflows)) { return $this->_issuetype_workflows[$issuetype->getID()]; } else { return TBGSettings::getCoreWorkflow(); } }