From 91ee6b78df3d78bce883633282b7b560c8b03766 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 16 Nov 2016 06:55:42 -0800 Subject: [PATCH] Make some confusing/weird Calendar fields not configurable on custom EditEngine forms Summary: Ref T11816. - Host gets weird behavior around defaulting to the viewer. - Invitees get weird behavior around defaulting to the viewer. - "All Day" is just sort of weird since start / end date aren't customizable. - Recurring/Frequency are weird here and don't make much sense. I can't immediately come up with reasons that any of these are particularly useful/valuable to default. More of them can be made editable after T10222 gets sorted out. Test Plan: Edited edit engine custom forms for Calendar events, saw a more sensible list of customizable fields (e.g., policy stuff). Reviewers: chad Reviewed By: chad Maniphest Tasks: T11816 Differential Revision: https://secure.phabricator.com/D16878 --- .../editor/PhabricatorCalendarEventEditEngine.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php index 5b31afbe1a..a9eab9376a 100644 --- a/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php +++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php @@ -108,6 +108,8 @@ final class PhabricatorCalendarEventEditEngine ->setConduitTypeDescription(pht('New event name.')) ->setValue($object->getName()), id(new PhabricatorBoolEditField()) + ->setIsLockable(false) + ->setIsDefaultable(false) ->setKey('isAllDay') ->setOptions(pht('Normal Event'), pht('All Day Event')) ->setAsCheckbox(true) @@ -151,6 +153,8 @@ final class PhabricatorCalendarEventEditEngine ->setConduitTypeDescription(pht('True to cancel the event.')) ->setValue($object->getIsCancelled()), id(new PhabricatorUsersEditField()) + ->setIsLockable(false) + ->setIsDefaultable(false) ->setKey('hostPHID') ->setAliases(array('host')) ->setLabel(pht('Host')) @@ -162,6 +166,8 @@ final class PhabricatorCalendarEventEditEngine ->setConduitTypeDescription(pht('New event host.')) ->setSingleValue($object->getHostPHID()), id(new PhabricatorDatasourceEditField()) + ->setIsLockable(false) + ->setIsDefaultable(false) ->setIsHidden($is_future) ->setKey('inviteePHIDs') ->setAliases(array('invite', 'invitee', 'invitees', 'inviteePHID')) @@ -203,6 +209,8 @@ final class PhabricatorCalendarEventEditEngine id(new PhabricatorBoolEditField()) ->setIsHidden(true) + ->setIsLockable(false) + ->setIsDefaultable(false) ->setKey('isRecurring') ->setLabel(pht('Recurring')) ->setOptions(pht('One-Time Event'), pht('Recurring Event')) @@ -213,6 +221,8 @@ final class PhabricatorCalendarEventEditEngine ->setConduitTypeDescription(pht('Mark the event as a recurring event.')) ->setValue(true), id(new PhabricatorSelectEditField()) + ->setIsLockable(false) + ->setIsDefaultable(false) ->setKey('frequency') ->setLabel(pht('Frequency')) ->setOptions($frequency_options)