/** * * @param IssueState $state * @param IssuePriority $priority * @return string */ public static function getHiliteBgColorClass($state, $priority) { if ($state->isTesting()) { return 'issue-hilitecol-testing'; } else { if ($state->isArchived()) { return 'issue-hilitecol-archived'; } else { if ($state->isOpen()) { switch ($priority->getId()) { case IssuePriority::LOW: return 'issue-hilitecol-low'; case IssuePriority::NORMAL: return 'issue-hilitecol-normal'; case IssuePriority::CRITICAL: return 'issue-hilitecol-critical'; } } } } return 'issue-hilitecol-closed'; }
require_once 'pages/report_details_dialog.php'; } } else { echo 'Report id is not valid !'; } break; //////// UPDATE ISSUES STATE //////// UPDATE ISSUES STATE case 'setissuesstate': $issueIds = @$_POST['issueIds']; $state = @$_POST['state']; if (ReportHelper::checkState($state)) { if (!empty($issueIds)) { if (DBHelper::updateIssuesState(explode(',', $issueIds), $state)) { echo 'O:'; $state = new IssueState($state); $priority = new IssuePriority(); $label = $state->getLabel(true); $issueIds = explode(',', $issueIds); $sep = ''; foreach ($issueIds as $issueId) { $res = DbHelper::selectRow(TBL_ISSUES, ISSUE_ID . '=' . $issueId, ISSUE_PRIORITY); $priority->setPriority($res[0][0]); echo $sep, $label, '|', IssueHelper::getHiliteBgColorClass($state, $priority), '|', strtolower($state->getName()); $sep = '||'; } } else { echo "K:Error occured while trying to update issue(s) state :\n\n" . DBHelper::getLastError(); } } else { echo 'K:Issue id(s) is not valid !';