Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118202929
PhabricatorCalendarEditEngine.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
Wed, Jun 18, 10:36
Size
4 KB
Mime Type
text/x-php
Expires
Fri, Jun 20, 10:36 (2 d)
Engine
blob
Format
Raw Data
Handle
26835690
Attached To
rPH Phabricator
PhabricatorCalendarEditEngine.php
View Options
<?php
final
class
PhabricatorCalendarEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'calendar.event'
;
public
function
getEngineName
()
{
return
pht
(
'Calendar Events'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Configure Calendar Event Forms'
);
}
public
function
getSummaryText
()
{
return
pht
(
'Configure how users create and edit events.'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorCalendarApplication'
;
}
protected
function
newEditableObject
()
{
return
PhabricatorCalendarEvent
::
initializeNewCalendarEvent
(
$this
->
getViewer
(),
$mode
=
null
);
}
protected
function
newObjectQuery
()
{
return
new
PhabricatorCalendarEventQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create New Event'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Event: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
$object
->
getMonogram
();
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Event'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Event'
);
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
getEditorURI
()
{
return
$this
->
getApplication
()->
getApplicationURI
(
'event/editpro/'
);
}
protected
function
buildCustomEditFields
(
$object
)
{
$viewer
=
$this
->
getViewer
();
if
(
$this
->
getIsCreate
())
{
$invitee_phids
=
array
(
$viewer
->
getPHID
());
}
else
{
$invitee_phids
=
$object
->
getInviteePHIDsForEdit
();
}
$fields
=
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the event.'
))
->
setIsRequired
(
true
)
->
setTransactionType
(
PhabricatorCalendarEventTransaction
::
TYPE_NAME
)
->
setConduitDescription
(
pht
(
'Rename the event.'
))
->
setConduitTypeDescription
(
pht
(
'New event name.'
))
->
setValue
(
$object
->
getName
()),
id
(
new
PhabricatorRemarkupEditField
())
->
setKey
(
'description'
)
->
setLabel
(
pht
(
'Description'
))
->
setDescription
(
pht
(
'Description of the event.'
))
->
setTransactionType
(
PhabricatorCalendarEventTransaction
::
TYPE_DESCRIPTION
)
->
setConduitDescription
(
pht
(
'Update the event description.'
))
->
setConduitTypeDescription
(
pht
(
'New event description.'
))
->
setValue
(
$object
->
getDescription
()),
id
(
new
PhabricatorBoolEditField
())
->
setKey
(
'cancelled'
)
->
setOptions
(
pht
(
'Active'
),
pht
(
'Cancelled'
))
->
setLabel
(
pht
(
'Cancelled'
))
->
setDescription
(
pht
(
'Cancel the event.'
))
->
setTransactionType
(
PhabricatorCalendarEventTransaction
::
TYPE_CANCEL
)
->
setIsConduitOnly
(
true
)
->
setConduitDescription
(
pht
(
'Cancel or restore the event.'
))
->
setConduitTypeDescription
(
pht
(
'True to cancel the event.'
))
->
setValue
(
$object
->
getIsCancelled
()),
id
(
new
PhabricatorDatasourceEditField
())
->
setKey
(
'inviteePHIDs'
)
->
setAliases
(
array
(
'invite'
,
'invitee'
,
'invitees'
,
'inviteePHID'
))
->
setLabel
(
pht
(
'Invitees'
))
->
setDatasource
(
new
PhabricatorMetaMTAMailableDatasource
())
->
setTransactionType
(
PhabricatorCalendarEventTransaction
::
TYPE_INVITE
)
->
setDescription
(
pht
(
'Users invited to the event.'
))
->
setConduitDescription
(
pht
(
'Change invited users.'
))
->
setConduitTypeDescription
(
pht
(
'New event invitees.'
))
->
setValue
(
$invitee_phids
)
->
setCommentActionLabel
(
pht
(
'Change Invitees'
)),
id
(
new
PhabricatorIconSetEditField
())
->
setKey
(
'icon'
)
->
setLabel
(
pht
(
'Icon'
))
->
setIconSet
(
new
PhabricatorCalendarIconSet
())
->
setTransactionType
(
PhabricatorCalendarEventTransaction
::
TYPE_ICON
)
->
setDescription
(
pht
(
'Event icon.'
))
->
setConduitDescription
(
pht
(
'Change the event icon.'
))
->
setConduitTypeDescription
(
pht
(
'New event icon.'
))
->
setValue
(
$object
->
getIcon
()),
);
return
$fields
;
}
}
Event Timeline
Log In to Comment