Page MenuHomePhorge

PHUIUserAvailabilityView.php
No OneTemporary

Size
884 B
Referenced Files
None
Subscribers
None

PHUIUserAvailabilityView.php

<?php
final class PHUIUserAvailabilityView
extends AphrontTagView {
private $user;
public function setAvailableUser(PhabricatorUser $user) {
$this->user = $user;
return $this;
}
public function getAvailableUser() {
return $this->user;
}
protected function getTagContent() {
$viewer = $this->getViewer();
$user = $this->getAvailableUser();
$until = $user->getAwayUntil();
if (!$until) {
return pht('Available');
}
$away_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE)
->setShade(PHUITagView::COLOR_RED)
->setName(pht('Away'))
->setDotColor(PHUITagView::COLOR_RED);
$now = PhabricatorTime::getNow();
$description = pht(
'Away until %s',
$viewer->formatShortDateTime($until, $now));
return array(
$away_tag,
' ',
$description,
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, May 11, 5:35 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
99573
Default Alt Text
PHUIUserAvailabilityView.php (884 B)

Event Timeline