コード例 #1
0
 public static function loadFixtures(TBGScope $scope, TBGWorkflow $workflow)
 {
     $steps = array();
     $steps['new'] = array('name' => 'New', 'description' => 'A new issue, not yet handled', 'status_id' => TBGStatus::getStatusByKeyish('new')->getID(), 'transitions' => array('investigateissue', 'confirmissue', 'rejectissue', 'acceptissue', 'resolveissue'), 'editable' => true, 'is_closed' => false);
     $steps['investigating'] = array('name' => 'Investigating', 'description' => 'An issue that is being investigated, looked into or is by other means between new and unconfirmed state', 'status_id' => TBGStatus::getStatusByKeyish('investigating')->getID(), 'transitions' => array('requestmoreinformation', 'confirmissue', 'rejectissue', 'acceptissue'), 'editable' => true, 'is_closed' => false);
     $steps['confirmed'] = array('name' => 'Confirmed', 'description' => 'An issue that has been confirmed', 'status_id' => TBGStatus::getStatusByKeyish('confirmed')->getID(), 'transitions' => array('acceptissue', 'assignissue', 'resolveissue'), 'editable' => false, 'is_closed' => false);
     $steps['inprogress'] = array('name' => 'In progress', 'description' => 'An issue that is being adressed', 'status_id' => TBGStatus::getStatusByKeyish('beingworkedon')->getID(), 'transitions' => array('rejectissue', 'markreadyfortesting', 'resolveissue'), 'editable' => false, 'is_closed' => false);
     $steps['readyfortesting'] = array('name' => 'Ready for testing', 'description' => 'An issue that has been marked fixed and is ready for testing', 'status_id' => TBGStatus::getStatusByKeyish('readyfortesting/qa')->getID(), 'transitions' => array('resolveissue', 'testissuesolution'), 'editable' => false, 'is_closed' => false);
     $steps['testing'] = array('name' => 'Testing', 'description' => 'An issue where the proposed or implemented solution is currently being tested or approved', 'status_id' => TBGStatus::getStatusByKeyish('testing/qa')->getID(), 'transitions' => array('acceptissuesolution', 'rejectissuesolution'), 'editable' => false, 'is_closed' => false);
     $steps['rejected'] = array('name' => 'Rejected', 'description' => 'A closed issue that has been rejected', 'status_id' => TBGStatus::getStatusByKeyish('notabug')->getID(), 'transitions' => array('reopenissue'), 'editable' => false, 'is_closed' => true);
     $steps['closed'] = array('name' => 'Closed', 'description' => 'A closed issue', 'status_id' => null, 'transitions' => array('reopenissue'), 'editable' => false, 'is_closed' => true);
     foreach ($steps as $key => $step) {
         $step_object = new TBGWorkflowStep();
         $step_object->setWorkflow($workflow);
         $step_object->setName($step['name']);
         $step_object->setDescription($step['description']);
         $step_object->setLinkedStatusID($step['status_id']);
         $step_object->setIsClosed($step['is_closed']);
         $step_object->setIsEditable($step['editable']);
         $step_object->save();
         $steps[$key]['step'] = $step_object;
     }
     $transitions = TBGWorkflowTransition::loadFixtures($scope, $workflow, $steps);
     foreach ($steps as $step) {
         foreach ($step['transitions'] as $transition) {
             $step['step']->addOutgoingTransition($transitions[$transition]);
         }
     }
 }
コード例 #2
0
 public static function loadFixtures(TBGScope $scope)
 {
     $workflow = new TBGWorkflow();
     $workflow->setName("Default workflow");
     $workflow->setDescription("This is the default workflow. It is used by all projects with no specific workflow selected, and for issue types with no specific workflow specified. This workflow cannot be edited or removed.");
     $workflow->save();
     TBGWorkflowStep::loadFixtures($scope, $workflow);
 }
コード例 #3
0
 public function runConfigureWorkflows(TBGRequest $request)
 {
     $this->workflows = TBGWorkflow::getAll();
     if ($request->isMethod(TBGRequest::POST)) {
         try {
             $workflow_name = $request->getParameter('workflow_name');
             $workflow = new TBGWorkflow();
             $workflow->setName($workflow_name);
             $workflow->save();
             $step = new TBGWorkflowStep();
             $step->setName(TBGContext::getI18n()->__('New'));
             $step->setWorkflow($workflow);
             $step->save();
             $this->forward(TBGContext::getRouting()->generate('configure_workflow'));
         } catch (Exception $e) {
             $this->error = $e->getMessage();
         }
     }
 }
コード例 #4
0
ファイル: actions.class.php プロジェクト: oparoz/thebuggenie
 public function runConfigureWorkflows(TBGRequest $request)
 {
     $this->workflows = TBGWorkflow::getAll();
     if ($request->isPost()) {
         try {
             $workflow_name = $request['workflow_name'];
             $workflow = new TBGWorkflow();
             $workflow->setName($workflow_name);
             $workflow->save();
             $step = new TBGWorkflowStep();
             $step->setName($this->getI18n()->__('New'));
             $step->setWorkflow($workflow);
             $step->save();
             $transition = new TBGWorkflowTransition();
             $transition->setOutgoingStep($step);
             $transition->setName('Issue created');
             $transition->setWorkflow($workflow);
             $transition->setDescription('This is the initial transition for issues using this workflow');
             $transition->save();
             $workflow->setInitialTransition($transition);
             $workflow->save();
             $this->forward(TBGContext::getRouting()->generate('configure_workflow'));
         } catch (Exception $e) {
             $this->error = $e->getMessage();
         }
     }
 }
コード例 #5
0
 public function componentDashboardViewProjectStatistics()
 {
     switch ($this->view->getType()) {
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_PRIORITY:
             $counts = TBGContext::getCurrentProject()->getPriorityCount();
             $items = TBGPriority::getAll();
             $key = 'priority';
             break;
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_SEVERITY:
             $counts = TBGContext::getCurrentProject()->getSeverityCount();
             $items = TBGSeverity::getAll();
             $key = 'priority';
             break;
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_CATEGORY:
             $counts = TBGContext::getCurrentProject()->getCategoryCount();
             $items = TBGCategory::getAll();
             $key = 'category';
             break;
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_RESOLUTION:
             $counts = TBGContext::getCurrentProject()->getResolutionCount();
             $items = TBGResolution::getAll();
             $key = 'resolution';
             break;
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_STATUS:
             $counts = TBGContext::getCurrentProject()->getStatusCount();
             $items = TBGStatus::getAll();
             $key = 'status';
             break;
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_WORKFLOW_STEP:
             $counts = TBGContext::getCurrentProject()->getWorkflowCount();
             $items = TBGWorkflowStep::getAllByWorkflowSchemeID(TBGContext::getCurrentProject()->getWorkflowScheme()->getID());
             $key = 'workflowstep';
             break;
         case TBGDashboardView::VIEW_PROJECT_STATISTICS_STATE:
             $counts = TBGContext::getCurrentProject()->getStateCount();
             $items = array('open' => $this->getI18n()->__('Open'), 'closed' => $this->getI18n()->__('Closed'));
             $key = 'state';
             break;
     }
     $this->counts = $counts;
     $this->key = $key;
     $this->items = $items;
 }
コード例 #6
0
 public static function loadFixtures(TBGScope $scope)
 {
     $workflow = new TBGWorkflow();
     $workflow->setName("Default workflow");
     $workflow->setDescription("This is the default workflow. It is used by all projects with no specific workflow selected, and for issue types with no specific workflow specified. This workflow cannot be edited or removed.");
     $workflow->setScope($scope->getID());
     $workflow->save();
     TBGSettings::saveSetting(TBGSettings::SETTING_DEFAULT_WORKFLOW, $workflow->getID(), 'core', $scope->getID());
     TBGWorkflowStep::loadFixtures($scope, $workflow);
 }
コード例 #7
0
ファイル: TBGIssue.class.php プロジェクト: oparoz/thebuggenie
 public function setWorkflowStep(TBGWorkflowStep $step)
 {
     $this->_addChangedProperty('_workflow_step_id', $step->getID());
 }
コード例 #8
0
 protected function _populateWorkflowCount()
 {
     if ($this->_workflowstepcount === null) {
         $this->_workflowstepcount = array();
         $this->_workflowstepcount[0] = array('open' => 0, 'closed' => 0, 'percentage' => 0);
         foreach (TBGWorkflowStep::getAllByWorkflowSchemeID($this->getWorkflowScheme()->getID()) as $workflow_step_id => $workflow_step) {
             $this->_workflowstepcount[$workflow_step_id] = array('open' => 0, 'closed' => 0, 'percentage' => 0);
         }
         foreach (TBGIssuesTable::getTable()->getWorkflowStepCountByProjectID($this->getID()) as $workflow_step_id => $workflow_count) {
             $this->_workflowstepcount[$workflow_step_id] = $workflow_count;
         }
     }
 }