1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/people/customfield/PhabricatorUserStatusField.php
epriestley c9510cc118 Make it more clear that red dots next to usernames mean Calendar availability
Summary:
Ref T11809. We show a red dot next to a username to indicate that the user is away (on vacation, in a meeting, etc).

It's not very obvious what this means unless you know that's what it is: when you click the username or view a hovercard, there's no visual hint about what the red dot means. It does say "Away", but there is a lot of information and it doesn't visually connect the two.

Connect the two visually by putting a red dot next to the "Away" bit, too.

Test Plan:
Here's my version of it, this feels OK to me but could maybe be more designed:

{F1893916}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11809

Differential Revision: https://secure.phabricator.com/D16791
2016-11-02 13:45:43 -07:00

38 lines
794 B
PHP

<?php
final class PhabricatorUserStatusField
extends PhabricatorUserCustomField {
private $value;
public function getFieldKey() {
return 'user:status';
}
public function getFieldName() {
return pht('Availability');
}
public function getFieldDescription() {
return pht('Shows when a user is away or busy.');
}
public function shouldAppearInPropertyView() {
return true;
}
public function isFieldEnabled() {
return PhabricatorApplication::isClassInstalled(
'PhabricatorCalendarApplication');
}
public function renderPropertyViewValue(array $handles) {
$user = $this->getObject();
$viewer = $this->requireViewer();
return id(new PHUIUserAvailabilityView())
->setViewer($viewer)
->setAvailableUser($user);
}
}