Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889321
PhortuneAccountEditEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
3 KB
Referenced Files
None
Subscribers
None
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
::
class
;
}
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
)
{
if
(
$this
->
getIsCreate
(
)
)
{
return
$object
->
getURI
(
)
;
}
else
{
return
$object
->
getDetailsURI
(
)
;
}
}
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
)
,
id
(
new
PhabricatorTextEditField
(
)
)
->
setKey
(
'billingName'
)
->
setLabel
(
pht
(
'Billing Name'
)
)
->
setDescription
(
pht
(
'Account name for billing purposes.'
)
)
->
setConduitTypeDescription
(
pht
(
'New account billing name.'
)
)
->
setTransactionType
(
PhortuneAccountBillingNameTransaction
::
TRANSACTIONTYPE
)
->
setValue
(
$object
->
getBillingName
(
)
)
,
id
(
new
PhabricatorTextAreaEditField
(
)
)
->
setKey
(
'billingAddress'
)
->
setLabel
(
pht
(
'Billing Address'
)
)
->
setDescription
(
pht
(
'Account billing address.'
)
)
->
setConduitTypeDescription
(
pht
(
'New account billing address.'
)
)
->
setTransactionType
(
PhortuneAccountBillingAddressTransaction
::
TRANSACTIONTYPE
)
->
setValue
(
$object
->
getBillingAddress
(
)
)
,
)
;
return
$fields
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 12:00 (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124327
Default Alt Text
PhortuneAccountEditEngine.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment