Example #1
0
 /**
  * Get the consistency errors
  * @param int $teamid
  * @return mixed[][]
  */
 private function getConsistencyErrors($teamid)
 {
     $issueList = TeamCache::getInstance()->getTeam($teamid)->getTeamIssueList(TRUE);
     $ccheck = new ConsistencyCheck2($issueList, $teamid);
     $cerrList = $ccheck->checkBadBacklog();
     #$cerrList2 = $ccheck->checkUnassignedTasks();
     $consistencyErrors = NULL;
     if (count($cerrList) > 0 || count($cerrList2) > 0) {
         $consistencyErrors = array();
         foreach ($cerrList as $cerr) {
             $user = UserCache::getInstance()->getUser($cerr->userId);
             $issue = IssueCache::getInstance()->getIssue($cerr->bugId);
             $titleAttr = array(T_('Project') => $issue->getProjectName(), T_('Summary') => $issue->getSummary());
             $consistencyErrors[] = array('issueURL' => Tools::issueInfoURL($cerr->bugId, $titleAttr), 'issueStatus' => Constants::$statusNames[$cerr->status], 'date' => date("Y-m-d", $cerr->timestamp), 'user' => $user->getName(), 'severity' => $cerr->getLiteralSeverity(), 'severityColor' => $cerr->getSeverityColor(), 'desc' => $cerr->desc);
         }
         /*
                  if (0 != count($cerrList2)) {
                     $consistencyErrors[] = array(
                        'issueURL' => '',
                        'issueStatus' => '-',
                        'date' => '-',
                        'user' => '('.T_('unknown').')',
                        'severity' => T_('Warning'),
                        'severityColor' => 'color:orange',
                        'desc' => count($cerrList2).' '.T_('tasks are not assigned to anybody.')
                     );
                  }
         */
     }
     return $consistencyErrors;
 }