Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/customfield/PhabricatorUserStatusField.php
Show All 24 Lines | public function isFieldEnabled() { | ||||
return PhabricatorApplication::isClassInstalled( | return PhabricatorApplication::isClassInstalled( | ||||
'PhabricatorCalendarApplication'); | 'PhabricatorCalendarApplication'); | ||||
} | } | ||||
public function renderPropertyViewValue(array $handles) { | public function renderPropertyViewValue(array $handles) { | ||||
$user = $this->getObject(); | $user = $this->getObject(); | ||||
$viewer = $this->requireViewer(); | $viewer = $this->requireViewer(); | ||||
// Don't show availability for disabled users, since this is vaguely | |||||
// misleading to say "Availability: Available" and probably not useful. | |||||
if ($user->getIsDisabled()) { | |||||
return null; | |||||
} | |||||
return id(new PHUIUserAvailabilityView()) | return id(new PHUIUserAvailabilityView()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setAvailableUser($user); | ->setAvailableUser($user); | ||||
} | } | ||||
} | } |