Differential D17203 Diff 41364 src/applications/audit/constants/PhabricatorAuditCommitStatusConstants.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/constants/PhabricatorAuditCommitStatusConstants.php
<?php | <?php | ||||
final class PhabricatorAuditCommitStatusConstants extends Phobject { | final class PhabricatorAuditCommitStatusConstants extends Phobject { | ||||
const NONE = 0; | const NONE = 0; | ||||
const NEEDS_AUDIT = 1; | const NEEDS_AUDIT = 1; | ||||
const CONCERN_RAISED = 2; | const CONCERN_RAISED = 2; | ||||
const PARTIALLY_AUDITED = 3; | const PARTIALLY_AUDITED = 3; | ||||
const FULLY_AUDITED = 4; | const FULLY_AUDITED = 4; | ||||
public static function getStatusNameMap() { | public static function getStatusNameMap() { | ||||
$map = array( | $map = array( | ||||
self::NONE => pht('None'), | self::NONE => pht('No Audits'), | ||||
self::NEEDS_AUDIT => pht('Audit Required'), | self::NEEDS_AUDIT => pht('Audit Required'), | ||||
self::CONCERN_RAISED => pht('Concern Raised'), | self::CONCERN_RAISED => pht('Concern Raised'), | ||||
self::PARTIALLY_AUDITED => pht('Partially Audited'), | self::PARTIALLY_AUDITED => pht('Partially Audited'), | ||||
self::FULLY_AUDITED => pht('Audited'), | self::FULLY_AUDITED => pht('Audited'), | ||||
); | ); | ||||
return $map; | return $map; | ||||
} | } | ||||
Show All 19 Lines | switch ($code) { | ||||
$color = 'orange'; | $color = 'orange'; | ||||
break; | break; | ||||
case self::PARTIALLY_AUDITED: | case self::PARTIALLY_AUDITED: | ||||
$color = 'yellow'; | $color = 'yellow'; | ||||
break; | break; | ||||
case self::FULLY_AUDITED: | case self::FULLY_AUDITED: | ||||
$color = 'green'; | $color = 'green'; | ||||
break; | break; | ||||
case self::NONE: | |||||
$color = 'bluegrey'; | |||||
break; | |||||
default: | default: | ||||
$color = null; | $color = null; | ||||
break; | break; | ||||
} | } | ||||
return $color; | return $color; | ||||
} | } | ||||
public static function getStatusIcon($code) { | public static function getStatusIcon($code) { | ||||
switch ($code) { | switch ($code) { | ||||
case self::CONCERN_RAISED: | case self::CONCERN_RAISED: | ||||
$icon = 'fa-exclamation-circle'; | $icon = 'fa-times-circle'; | ||||
break; | break; | ||||
case self::NEEDS_AUDIT: | case self::NEEDS_AUDIT: | ||||
case self::PARTIALLY_AUDITED: | |||||
$icon = 'fa-exclamation-circle'; | $icon = 'fa-exclamation-circle'; | ||||
break; | break; | ||||
case self::PARTIALLY_AUDITED: | |||||
$icon = 'fa-check-circle-o'; | |||||
break; | |||||
case self::FULLY_AUDITED: | case self::FULLY_AUDITED: | ||||
$icon = 'fa-check-circle'; | |||||
break; | |||||
case self::NONE: | |||||
$icon = 'fa-check'; | $icon = 'fa-check'; | ||||
break; | break; | ||||
default: | default: | ||||
$icon = null; | $icon = null; | ||||
break; | break; | ||||
} | } | ||||
return $icon; | return $icon; | ||||
} | } | ||||
} | } |