2013-07-10 21:34:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorUserStatusField
|
|
|
|
extends PhabricatorUserCustomField {
|
|
|
|
|
|
|
|
private $value;
|
|
|
|
|
|
|
|
public function getFieldKey() {
|
|
|
|
return 'user:status';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFieldName() {
|
|
|
|
return pht('Status');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFieldDescription() {
|
|
|
|
return pht('Shows when a user is away or busy.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldAppearInPropertyView() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-06-16 23:18:50 +02:00
|
|
|
public function isFieldEnabled() {
|
|
|
|
return PhabricatorApplication::isClassInstalled(
|
2014-07-23 02:03:09 +02:00
|
|
|
'PhabricatorCalendarApplication');
|
2014-06-16 23:18:50 +02:00
|
|
|
}
|
|
|
|
|
2014-02-26 23:46:18 +01:00
|
|
|
public function renderPropertyViewValue(array $handles) {
|
2013-07-10 21:34:09 +02:00
|
|
|
$user = $this->getObject();
|
|
|
|
$viewer = $this->requireViewer();
|
2015-05-14 20:15:04 +02:00
|
|
|
return $user->getAvailabilityDescription($viewer);
|
2013-07-10 21:34:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|