1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 12:42:43 +01:00
phorge-phorge/src/applications/releeph/constants/ReleephRequestStatus.php
Edward Speyer da92d79d8d ReleephRequestStatus
Summary: This is just a bit of gardening in order to make the responsive-UI diff easier; I'll be putting `getColorFor($status)` type things in this class, following the pattern in `ManiphestTaskStatus`.

Test Plan: Poke around Releeph.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5893
2013-05-11 15:20:16 +01:00

32 lines
1.1 KiB
PHP

<?php
final class ReleephRequestStatus {
const STATUS_REQUESTED = 1;
const STATUS_NEEDS_PICK = 2; // aka approved
const STATUS_REJECTED = 3;
const STATUS_ABANDONED = 4;
const STATUS_PICKED = 5;
const STATUS_REVERTED = 6;
const STATUS_NEEDS_REVERT = 7; // aka revert requested
public static function getStatusDescriptionFor($status) {
$descriptions = array(
self::STATUS_REQUESTED => pht('Requested'),
self::STATUS_REJECTED => pht('Rejected'),
self::STATUS_ABANDONED => pht('Abandoned'),
self::STATUS_PICKED => pht('Picked'),
self::STATUS_REVERTED => pht('Reverted'),
self::STATUS_NEEDS_PICK => pht('Needs Pick'),
self::STATUS_NEEDS_REVERT => pht('Needs Revert'),
);
return idx($descriptions, $status, '??');
}
public static function getStatusClassSuffixFor($status) {
$description = self::getStatusDescriptionFor($status);
$class = str_replace(' ', '-', strtolower($description));
return $class;
}
}