Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/metamta/constants/PhabricatorMailOutboundStatus.php
12256 views
1
<?php
2
3
final class PhabricatorMailOutboundStatus
4
extends Phobject {
5
6
const STATUS_QUEUE = 'queued';
7
const STATUS_SENT = 'sent';
8
const STATUS_FAIL = 'fail';
9
const STATUS_VOID = 'void';
10
11
12
public static function getStatusName($status_code) {
13
$names = array(
14
self::STATUS_QUEUE => pht('Queued'),
15
self::STATUS_FAIL => pht('Delivery Failed'),
16
self::STATUS_SENT => pht('Sent'),
17
self::STATUS_VOID => pht('Voided'),
18
);
19
$status_code = coalesce($status_code, '?');
20
return idx($names, $status_code, $status_code);
21
}
22
23
public static function getStatusIcon($status_code) {
24
$icons = array(
25
self::STATUS_QUEUE => 'fa-clock-o',
26
self::STATUS_FAIL => 'fa-warning',
27
self::STATUS_SENT => 'fa-envelope',
28
self::STATUS_VOID => 'fa-trash',
29
);
30
return idx($icons, $status_code, 'fa-question-circle');
31
}
32
33
public static function getStatusColor($status_code) {
34
$colors = array(
35
self::STATUS_QUEUE => 'blue',
36
self::STATUS_FAIL => 'red',
37
self::STATUS_SENT => 'green',
38
self::STATUS_VOID => 'black',
39
);
40
41
return idx($colors, $status_code, 'yellow');
42
}
43
44
}
45
46