3 final class ReleephRequestStatus
extends Phobject
{
5 const STATUS_REQUESTED
= 1;
6 const STATUS_NEEDS_PICK
= 2; // aka approved
7 const STATUS_REJECTED
= 3;
8 const STATUS_ABANDONED
= 4;
9 const STATUS_PICKED
= 5;
10 const STATUS_REVERTED
= 6;
11 const STATUS_NEEDS_REVERT
= 7; // aka revert requested
13 public static function getStatusDescriptionFor($status) {
14 $descriptions = array(
15 self
::STATUS_REQUESTED
=> pht('Requested'),
16 self
::STATUS_REJECTED
=> pht('Rejected'),
17 self
::STATUS_ABANDONED
=> pht('Abandoned'),
18 self
::STATUS_PICKED
=> pht('Pulled'),
19 self
::STATUS_REVERTED
=> pht('Reverted'),
20 self
::STATUS_NEEDS_PICK
=> pht('Needs Pull'),
21 self
::STATUS_NEEDS_REVERT
=> pht('Needs Revert'),
23 return idx($descriptions, $status, '??');
26 public static function getStatusClassSuffixFor($status) {
27 $description = self
::getStatusDescriptionFor($status);
28 $class = str_replace(' ', '-', strtolower($description));