Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105968610
PhabricatorUserTitleField.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, Mar 21, 04:39
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Mar 23, 04:39 (2 d)
Engine
blob
Format
Raw Data
Handle
25086985
Attached To
rPH Phabricator
PhabricatorUserTitleField.php
View Options
<?php
final
class
PhabricatorUserTitleField
extends
PhabricatorUserCustomField
{
private
$value
;
public
function
getFieldKey
()
{
return
'user:title'
;
}
public
function
getFieldName
()
{
return
pht
(
'Title'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'User title, like "CEO" or "Assistant to the Manager".'
);
}
public
function
canDisableField
()
{
return
false
;
}
public
function
shouldAppearInApplicationTransactions
()
{
return
true
;
}
public
function
shouldAppearInEditView
()
{
return
true
;
}
protected
function
didSetObject
(
PhabricatorCustomFieldInterface
$object
)
{
$this
->
value
=
$object
->
loadUserProfile
()->
getTitle
();
}
public
function
getOldValueForApplicationTransactions
()
{
return
$this
->
getObject
()->
loadUserProfile
()->
getTitle
();
}
public
function
getNewValueForApplicationTransactions
()
{
return
$this
->
value
;
}
public
function
applyApplicationTransactionInternalEffects
(
PhabricatorApplicationTransaction
$xaction
)
{
$this
->
getObject
()->
loadUserProfile
()->
setTitle
(
$xaction
->
getNewValue
());
}
public
function
readValueFromRequest
(
AphrontRequest
$request
)
{
$this
->
value
=
$request
->
getStr
(
$this
->
getFieldKey
());
}
public
function
renderEditControl
()
{
return
id
(
new
AphrontFormTextControl
())
->
setName
(
$this
->
getFieldKey
())
->
setValue
(
$this
->
value
)
->
setLabel
(
$this
->
getFieldName
())
->
setCaption
(
pht
(
'Serious business title.'
));
}
}
Event Timeline
Log In to Comment