Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F107418272
PhortuneAccountEditEngine.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
Tue, Apr 8, 01:55
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Apr 10, 01:55 (2 d)
Engine
blob
Format
Raw Data
Handle
25415155
Attached To
rPH Phabricator
PhortuneAccountEditEngine.php
View Options
<?php
final
class
PhortuneAccountEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'phortune.account'
;
public
function
getEngineName
()
{
return
pht
(
'Phortune Accounts'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorPhortuneApplication'
;
}
public
function
getSummaryHeader
()
{
return
pht
(
'Configure Phortune Account Forms'
);
}
public
function
getSummaryText
()
{
return
pht
(
'Configure creation and editing forms in Phortune Accounts.'
);
}
public
function
isEngineConfigurable
()
{
return
false
;
}
protected
function
newEditableObject
()
{
return
PhortuneAccount
::
initializeNewAccount
(
$this
->
getViewer
());
}
protected
function
newObjectQuery
()
{
return
new
PhortuneAccountQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Payment Account'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Account: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
$object
->
getName
();
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Account'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Account'
);
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
$this
->
getApplication
()->
getApplicationURI
(
'/'
);
}
protected
function
getEditorURI
()
{
return
$this
->
getApplication
()->
getApplicationURI
(
'edit/'
);
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
buildCustomEditFields
(
$object
)
{
$viewer
=
$this
->
getViewer
();
if
(
$this
->
getIsCreate
())
{
$member_phids
=
array
(
$viewer
->
getPHID
());
}
else
{
$member_phids
=
$object
->
getMemberPHIDs
();
}
$fields
=
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Account name.'
))
->
setConduitTypeDescription
(
pht
(
'New account name.'
))
->
setTransactionType
(
PhortuneAccountNameTransaction
::
TRANSACTIONTYPE
)
->
setValue
(
$object
->
getName
())
->
setIsRequired
(
true
),
id
(
new
PhabricatorUsersEditField
())
->
setKey
(
'managers'
)
->
setAliases
(
array
(
'memberPHIDs'
,
'managerPHIDs'
))
->
setLabel
(
pht
(
'Managers'
))
->
setUseEdgeTransactions
(
true
)
->
setTransactionType
(
PhabricatorTransactions
::
TYPE_EDGE
)
->
setMetadataValue
(
'edge:type'
,
PhortuneAccountHasMemberEdgeType
::
EDGECONST
)
->
setDescription
(
pht
(
'Initial account managers.'
))
->
setConduitDescription
(
pht
(
'Set account managers.'
))
->
setConduitTypeDescription
(
pht
(
'New list of managers.'
))
->
setInitialValue
(
$object
->
getMemberPHIDs
())
->
setValue
(
$member_phids
),
);
return
$fields
;
}
}
Event Timeline
Log In to Comment