Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F117909906
PHUIUserAvailabilityView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jun 16, 12:16
Size
884 B
Mime Type
text/x-php
Expires
Wed, Jun 18, 12:16 (2 d)
Engine
blob
Format
Raw Data
Handle
26817385
Attached To
rPH Phabricator
PHUIUserAvailabilityView.php
View Options
<?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
,
);
}
}
Event Timeline
Log In to Comment