2012-02-29 06:06:34 +01:00
|
|
|
<?php
|
|
|
|
|
2015-06-15 10:02:26 +02:00
|
|
|
final class PhabricatorAuditCommitStatusConstants extends Phobject {
|
2012-02-29 06:06:34 +01:00
|
|
|
|
|
|
|
const NONE = 0;
|
|
|
|
const NEEDS_AUDIT = 1;
|
|
|
|
const CONCERN_RAISED = 2;
|
|
|
|
const PARTIALLY_AUDITED = 3;
|
|
|
|
const FULLY_AUDITED = 4;
|
|
|
|
|
|
|
|
public static function getStatusNameMap() {
|
2013-05-18 19:49:37 +02:00
|
|
|
$map = array(
|
2017-01-13 01:31:33 +01:00
|
|
|
self::NONE => pht('No Audits'),
|
2013-05-18 19:49:37 +02:00
|
|
|
self::NEEDS_AUDIT => pht('Audit Required'),
|
|
|
|
self::CONCERN_RAISED => pht('Concern Raised'),
|
|
|
|
self::PARTIALLY_AUDITED => pht('Partially Audited'),
|
|
|
|
self::FULLY_AUDITED => pht('Audited'),
|
2012-02-29 06:06:34 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
return $map;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getStatusName($code) {
|
2015-05-22 09:27:56 +02:00
|
|
|
return idx(self::getStatusNameMap(), $code, pht('Unknown'));
|
2012-02-29 06:06:34 +01:00
|
|
|
}
|
|
|
|
|
2013-02-28 16:55:06 +01:00
|
|
|
public static function getOpenStatusConstants() {
|
|
|
|
return array(
|
|
|
|
self::CONCERN_RAISED,
|
|
|
|
self::NEEDS_AUDIT,
|
2017-01-12 17:49:36 +01:00
|
|
|
self::PARTIALLY_AUDITED,
|
2013-02-28 16:55:06 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-01-07 01:07:47 +01:00
|
|
|
public static function getStatusColor($code) {
|
|
|
|
switch ($code) {
|
|
|
|
case self::CONCERN_RAISED:
|
|
|
|
$color = 'red';
|
|
|
|
break;
|
|
|
|
case self::NEEDS_AUDIT:
|
|
|
|
$color = 'orange';
|
|
|
|
break;
|
2016-03-17 20:01:22 +01:00
|
|
|
case self::PARTIALLY_AUDITED:
|
|
|
|
$color = 'yellow';
|
|
|
|
break;
|
2014-01-07 01:07:47 +01:00
|
|
|
case self::FULLY_AUDITED:
|
|
|
|
$color = 'green';
|
|
|
|
break;
|
2017-01-13 01:31:33 +01:00
|
|
|
case self::NONE:
|
|
|
|
$color = 'bluegrey';
|
|
|
|
break;
|
2014-01-07 01:07:47 +01:00
|
|
|
default:
|
|
|
|
$color = null;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return $color;
|
|
|
|
}
|
|
|
|
|
2015-06-19 14:18:42 +02:00
|
|
|
public static function getStatusIcon($code) {
|
|
|
|
switch ($code) {
|
|
|
|
case self::CONCERN_RAISED:
|
2017-01-13 01:31:33 +01:00
|
|
|
$icon = 'fa-times-circle';
|
2015-06-19 14:18:42 +02:00
|
|
|
break;
|
|
|
|
case self::NEEDS_AUDIT:
|
2016-03-17 20:01:22 +01:00
|
|
|
$icon = 'fa-exclamation-circle';
|
2015-06-19 14:18:42 +02:00
|
|
|
break;
|
2017-01-13 01:31:33 +01:00
|
|
|
case self::PARTIALLY_AUDITED:
|
|
|
|
$icon = 'fa-check-circle-o';
|
|
|
|
break;
|
2015-06-19 14:18:42 +02:00
|
|
|
case self::FULLY_AUDITED:
|
2017-01-13 01:31:33 +01:00
|
|
|
$icon = 'fa-check-circle';
|
|
|
|
break;
|
|
|
|
case self::NONE:
|
2015-06-19 14:18:42 +02:00
|
|
|
$icon = 'fa-check';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$icon = null;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return $icon;
|
|
|
|
}
|
|
|
|
|
2012-02-29 06:06:34 +01:00
|
|
|
}
|