Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64031682
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
Fri, May 24, 02:34
Size
1003 B
Mime Type
text/x-php
Expires
Sun, May 26, 02:34 (2 d)
Engine
blob
Format
Raw Data
Handle
17847286
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
(
'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
();
// 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
())
->
setViewer
(
$viewer
)
->
setAvailableUser
(
$user
);
}
}
Event Timeline
Log In to Comment