2013-07-28 03:37:17 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PonderQuestionStatus extends PonderConstants {
|
|
|
|
|
2015-08-08 19:23:33 +02:00
|
|
|
const STATUS_OPEN = 'open';
|
|
|
|
const STATUS_CLOSED_RESOLVED = 'resolved';
|
|
|
|
const STATUS_CLOSED_OBSOLETE = 'obsolete';
|
2015-08-29 17:29:23 +02:00
|
|
|
const STATUS_CLOSED_INVALID = 'invalid';
|
2013-07-28 03:37:17 +02:00
|
|
|
|
|
|
|
public static function getQuestionStatusMap() {
|
|
|
|
return array(
|
2015-08-08 19:23:33 +02:00
|
|
|
self::STATUS_OPEN => pht('Open'),
|
|
|
|
self::STATUS_CLOSED_RESOLVED => pht('Closed, Resolved'),
|
|
|
|
self::STATUS_CLOSED_OBSOLETE => pht('Closed, Obsolete'),
|
2015-08-29 17:29:23 +02:00
|
|
|
self::STATUS_CLOSED_INVALID => pht('Closed, Invalid'),
|
2013-07-28 03:37:17 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getQuestionStatusFullName($status) {
|
|
|
|
$map = array(
|
2015-08-08 19:23:33 +02:00
|
|
|
self::STATUS_OPEN => pht('Open'),
|
|
|
|
self::STATUS_CLOSED_RESOLVED => pht('Closed, Resolved'),
|
|
|
|
self::STATUS_CLOSED_OBSOLETE => pht('Closed, Obsolete'),
|
2015-08-29 17:29:23 +02:00
|
|
|
self::STATUS_CLOSED_INVALID => pht('Closed, Invalid'),
|
2015-08-08 19:23:33 +02:00
|
|
|
);
|
|
|
|
return idx($map, $status, pht('Unknown'));
|
|
|
|
}
|
|
|
|
|
2015-08-10 23:55:43 +02:00
|
|
|
public static function getQuestionStatusName($status) {
|
|
|
|
$map = array(
|
|
|
|
self::STATUS_OPEN => pht('Open'),
|
|
|
|
self::STATUS_CLOSED_RESOLVED => pht('Resolved'),
|
|
|
|
self::STATUS_CLOSED_OBSOLETE => pht('Obsolete'),
|
2015-08-29 17:29:23 +02:00
|
|
|
self::STATUS_CLOSED_INVALID => pht('Invalid'),
|
2015-08-10 23:55:43 +02:00
|
|
|
);
|
|
|
|
return idx($map, $status, pht('Unknown'));
|
|
|
|
}
|
|
|
|
|
2015-08-08 19:23:33 +02:00
|
|
|
public static function getQuestionStatusDescription($status) {
|
|
|
|
$map = array(
|
|
|
|
self::STATUS_OPEN =>
|
|
|
|
pht('This question is open for answers.'),
|
|
|
|
self::STATUS_CLOSED_RESOLVED =>
|
2015-08-12 16:56:31 +02:00
|
|
|
pht('This question has been answered or resolved.'),
|
2015-08-08 19:23:33 +02:00
|
|
|
self::STATUS_CLOSED_OBSOLETE =>
|
2015-08-29 17:29:23 +02:00
|
|
|
pht('This question is out of date.'),
|
|
|
|
self::STATUS_CLOSED_INVALID =>
|
|
|
|
pht('This question is invalid.'),
|
2013-07-28 03:37:17 +02:00
|
|
|
);
|
2015-05-22 09:27:56 +02:00
|
|
|
return idx($map, $status, pht('Unknown'));
|
2013-07-28 03:37:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function getQuestionStatusTagColor($status) {
|
|
|
|
$map = array(
|
2015-05-29 00:17:34 +02:00
|
|
|
self::STATUS_OPEN => PHUITagView::COLOR_BLUE,
|
2015-08-08 19:23:33 +02:00
|
|
|
self::STATUS_CLOSED_RESOLVED => PHUITagView::COLOR_BLACK,
|
|
|
|
self::STATUS_CLOSED_OBSOLETE => PHUITagView::COLOR_BLACK,
|
2015-08-29 17:29:23 +02:00
|
|
|
self::STATUS_CLOSED_INVALID => PHUITagView::COLOR_BLACK,
|
2013-07-28 03:37:17 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
return idx($map, $status);
|
|
|
|
}
|
|
|
|
|
2015-05-29 00:17:34 +02:00
|
|
|
public static function getQuestionStatusIcon($status) {
|
|
|
|
$map = array(
|
|
|
|
self::STATUS_OPEN => 'fa-question-circle',
|
2015-08-08 19:23:33 +02:00
|
|
|
self::STATUS_CLOSED_RESOLVED => 'fa-check',
|
|
|
|
self::STATUS_CLOSED_OBSOLETE => 'fa-ban',
|
2015-08-29 17:29:23 +02:00
|
|
|
self::STATUS_CLOSED_INVALID => 'fa-ban',
|
2015-05-29 00:17:34 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
return idx($map, $status);
|
|
|
|
}
|
|
|
|
|
2015-08-08 19:23:33 +02:00
|
|
|
public static function getQuestionStatusOpenMap() {
|
|
|
|
return array(
|
|
|
|
self::STATUS_OPEN,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getQuestionStatusClosedMap() {
|
|
|
|
return array(
|
|
|
|
self::STATUS_CLOSED_RESOLVED,
|
|
|
|
self::STATUS_CLOSED_OBSOLETE,
|
2015-08-29 17:29:23 +02:00
|
|
|
self::STATUS_CLOSED_INVALID,
|
2015-08-08 19:23:33 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-07-28 03:37:17 +02:00
|
|
|
}
|