Exemplo n.º 1
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;
 }
Exemplo n.º 2
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;
         }
     }
 }