Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100722209
PhabricatorUserStatusField.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
Sun, Feb 2, 05:01
Size
775 B
Mime Type
text/x-php
Expires
Tue, Feb 4, 05:01 (2 d)
Engine
blob
Format
Raw Data
Handle
24018792
Attached To
rPH Phabricator
PhabricatorUserStatusField.php
View Options
<?php
final
class
PhabricatorUserStatusField
extends
PhabricatorUserCustomField
{
private
$value
;
public
function
getFieldKey
()
{
return
'user:status'
;
}
public
function
getFieldName
()
{
return
pht
(
'Status'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Shows when a user is away or busy.'
);
}
public
function
shouldAppearInPropertyView
()
{
return
true
;
}
public
function
renderPropertyViewValue
()
{
$user
=
$this
->
getObject
();
$viewer
=
$this
->
requireViewer
();
$statuses
=
id
(
new
PhabricatorCalendarEvent
())
->
loadCurrentStatuses
(
array
(
$user
->
getPHID
()));
if
(!
$statuses
)
{
return
pht
(
'Available'
);
}
$status
=
head
(
$statuses
);
return
$status
->
getTerseSummary
(
$viewer
);
}
}
Event Timeline
Log In to Comment