Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/editor/PhabricatorCalendarEditEngine.php
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | protected function getObjectViewURI($object) { | ||||
return $object->getURI(); | return $object->getURI(); | ||||
} | } | ||||
protected function getEditorURI() { | protected function getEditorURI() { | ||||
return $this->getApplication()->getApplicationURI('event/editpro/'); | return $this->getApplication()->getApplicationURI('event/editpro/'); | ||||
} | } | ||||
protected function buildCustomEditFields($object) { | protected function buildCustomEditFields($object) { | ||||
$viewer = $this->getViewer(); | |||||
if ($this->getIsCreate()) { | |||||
$invitee_phids = array($viewer->getPHID()); | |||||
} else { | |||||
$invitee_phids = $object->getInviteePHIDsForEdit(); | |||||
} | |||||
$fields = array( | $fields = array( | ||||
id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
->setKey('name') | ->setKey('name') | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setDescription(pht('Name of the event.')) | ->setDescription(pht('Name of the event.')) | ||||
->setIsRequired(true) | ->setIsRequired(true) | ||||
->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_NAME) | ->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_NAME) | ||||
->setConduitDescription(pht('Rename the event.')) | ->setConduitDescription(pht('Rename the event.')) | ||||
Show All 14 Lines | $fields = array( | ||||
->setLabel(pht('Cancelled')) | ->setLabel(pht('Cancelled')) | ||||
->setDescription(pht('Cancel the event.')) | ->setDescription(pht('Cancel the event.')) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorCalendarEventTransaction::TYPE_CANCEL) | PhabricatorCalendarEventTransaction::TYPE_CANCEL) | ||||
->setIsConduitOnly(true) | ->setIsConduitOnly(true) | ||||
->setConduitDescription(pht('Cancel or restore the event.')) | ->setConduitDescription(pht('Cancel or restore the event.')) | ||||
->setConduitTypeDescription(pht('True to cancel the event.')) | ->setConduitTypeDescription(pht('True to cancel the event.')) | ||||
->setValue($object->getIsCancelled()), | ->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()) | id(new PhabricatorIconSetEditField()) | ||||
->setKey('icon') | ->setKey('icon') | ||||
->setLabel(pht('Icon')) | ->setLabel(pht('Icon')) | ||||
->setIconSet(new PhabricatorCalendarIconSet()) | ->setIconSet(new PhabricatorCalendarIconSet()) | ||||
->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_ICON) | ->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_ICON) | ||||
->setDescription(pht('Event icon.')) | ->setDescription(pht('Event icon.')) | ||||
->setConduitDescription(pht('Change the event icon.')) | ->setConduitDescription(pht('Change the event icon.')) | ||||
->setConduitTypeDescription(pht('New event icon.')) | ->setConduitTypeDescription(pht('New event icon.')) | ||||
->setValue($object->getIcon()), | ->setValue($object->getIcon()), | ||||
); | ); | ||||
return $fields; | return $fields; | ||||
} | } | ||||
} | } |