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() {
|
2016-11-02 18:02:51 +01:00
|
|
|
return pht('Availability');
|
2013-07-10 21:34:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
2016-11-02 18:02:51 +01:00
|
|
|
|
|
|
|
return id(new PHUIUserAvailabilityView())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->setAvailableUser($user);
|
2013-07-10 21:34:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|