public function loadFixtures()
 {
     // Load initial settings
     TBGSettingsTable::getTable()->loadFixtures($this);
     TBGSettings::loadSettings();
     // Load group, users and permissions fixtures
     TBGGroup::loadFixtures($this);
     // Load initial teams
     TBGTeam::loadFixtures($this);
     // Set up user states, like "available", "away", etc
     TBGUserstate::loadFixtures($this);
     // Set up data types
     list($b_id, $f_id, $e_id, $t_id, $u_id, $i_id) = TBGIssuetype::loadFixtures($this);
     $scheme = TBGIssuetypeScheme::loadFixtures($this);
     TBGIssueFieldsTable::getTable()->loadFixtures($this, $scheme, $b_id, $f_id, $e_id, $t_id, $u_id, $i_id);
     TBGDatatype::loadFixtures($this);
     // Set up workflows
     TBGWorkflow::loadFixtures($this);
     TBGWorkflowSchemesTable::getTable()->loadFixtures($this);
     TBGWorkflowIssuetypeTable::getTable()->loadFixtures($this);
     // Set up left menu links
     TBGLinksTable::getTable()->loadFixtures($this);
 }
 public function getAllByWorkflowSchemeID($scheme_id)
 {
     $crit = $this->getCriteria();
     $crit->addJoin(TBGWorkflowsTable::getTable(), TBGWorkflowsTable::ID, self::WORKFLOW_ID, array(), Criteria::DB_INNER_JOIN);
     $crit->addJoin(TBGWorkflowIssuetypeTable::getTable(), TBGWorkflowIssuetypeTable::WORKFLOW_ID, self::WORKFLOW_ID, array(), Criteria::DB_INNER_JOIN);
     $crit->addWhere(TBGWorkflowIssuetypeTable::WORKFLOW_SCHEME_ID, $scheme_id);
     $res = $this->doSelect($crit);
     $steps = array();
     if ($res) {
         while ($row = $res->getNextRow()) {
             $step_id = $row->get(self::ID);
             $steps[$step_id] = $step_id;
         }
     }
     return $steps;
 }
 public function unassociateIssuetype(TBGIssuetype $issuetype)
 {
     TBGWorkflowIssuetypeTable::getTable()->setWorkflowIDforIssuetypeIDwithSchemeID(null, $issuetype->getID(), $this->getID());
 }
 public function isInUse()
 {
     if ($this->_number_of_schemes === null) {
         $this->_number_of_schemes = TBGWorkflowIssuetypeTable::getTable()->countSchemesByWorkflowID($this->getID());
     }
     return (bool) $this->_number_of_schemes;
 }