3 final class PhabricatorAuditRequestStatus
extends Phobject
{
5 const AUDIT_REQUIRED
= 'audit-required';
6 const CONCERNED
= 'concerned';
7 const ACCEPTED
= 'accepted';
8 const AUDIT_REQUESTED
= 'requested';
9 const RESIGNED
= 'resigned';
13 public static function newForStatus($status) {
15 $result->key
= $status;
19 public function getIconIcon() {
20 return $this->getMapProperty('icon');
23 public function getIconColor() {
24 return $this->getMapProperty('icon.color');
27 public function getStatusName() {
28 $name = $this->getMapProperty('name');
33 return pht('Unknown Audit Request Status ("%s")', $this->key
);
36 public function getStatusValue() {
40 public function getStatusValueForConduit() {
41 return $this->getMapProperty('value.conduit');
44 public function isResigned() {
45 return ($this->key
=== self
::RESIGNED
);
48 private function getMapProperty($key, $default = null) {
49 $map = self
::newStatusMap();
50 $spec = idx($map, $this->key
, array());
51 return idx($spec, $key, $default);
54 private static function newStatusMap() {
56 self
::AUDIT_REQUIRED
=> array(
57 'name' => pht('Audit Required'),
58 'icon' => 'fa-exclamation-circle',
59 'icon.color' => 'orange',
60 'value.conduit' => 'audit-required',
62 self
::AUDIT_REQUESTED
=> array(
63 'name' => pht('Audit Requested'),
64 'icon' => 'fa-exclamation-circle',
65 'icon.color' => 'orange',
66 'value.conduit' => 'audit-requested',
68 self
::CONCERNED
=> array(
69 'name' => pht('Concern Raised'),
70 'icon' => 'fa-times-circle',
71 'icon.color' => 'red',
72 'value.conduit' => 'concern-raised',
74 self
::ACCEPTED
=> array(
75 'name' => pht('Accepted'),
76 'icon' => 'fa-check-circle',
77 'icon.color' => 'green',
78 'value.conduit' => 'accepted',
80 self
::RESIGNED
=> array(
81 'name' => pht('Resigned'),
83 'icon.color' => 'grey',
84 'value.conduit' => 'resigned',