@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move more event fields to EditEngine

Summary:
Ref T9275. This moves description, icon, and cancel/uncancel to EditEngine.

It removes TYPE_SEQUENCE_INDEX and TYPE_INSTANCE_OF_EVENT. These are currently never generated and I do not expect to genereate them (instead, these changes happen automatically when you edit a stub).

Test Plan: Edited an event with normal and pro edit forms.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9275

Differential Revision: https://secure.phabricator.com/D16264

+36 -33
+31 -2
src/applications/calendar/editor/PhabricatorCalendarEditEngine.php
··· 65 65 ->setKey('name') 66 66 ->setLabel(pht('Name')) 67 67 ->setDescription(pht('Name of the event.')) 68 + ->setIsRequired(true) 69 + ->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_NAME) 68 70 ->setConduitDescription(pht('Rename the event.')) 69 71 ->setConduitTypeDescription(pht('New event name.')) 70 - ->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_NAME) 71 - ->setIsRequired(true) 72 72 ->setValue($object->getName()), 73 + id(new PhabricatorRemarkupEditField()) 74 + ->setKey('description') 75 + ->setLabel(pht('Description')) 76 + ->setDescription(pht('Description of the event.')) 77 + ->setTransactionType( 78 + PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION) 79 + ->setConduitDescription(pht('Update the event description.')) 80 + ->setConduitTypeDescription(pht('New event description.')) 81 + ->setValue($object->getDescription()), 82 + id(new PhabricatorBoolEditField()) 83 + ->setKey('cancelled') 84 + ->setOptions(pht('Active'), pht('Cancelled')) 85 + ->setLabel(pht('Cancelled')) 86 + ->setDescription(pht('Cancel the event.')) 87 + ->setTransactionType( 88 + PhabricatorCalendarEventTransaction::TYPE_CANCEL) 89 + ->setIsConduitOnly(true) 90 + ->setConduitDescription(pht('Cancel or restore the event.')) 91 + ->setConduitTypeDescription(pht('True to cancel the event.')) 92 + ->setValue($object->getIsCancelled()), 93 + id(new PhabricatorIconSetEditField()) 94 + ->setKey('icon') 95 + ->setLabel(pht('Icon')) 96 + ->setIconSet(new PhabricatorCalendarIconSet()) 97 + ->setTransactionType(PhabricatorCalendarEventTransaction::TYPE_ICON) 98 + ->setDescription(pht('Event icon.')) 99 + ->setConduitDescription(pht('Change the event icon.')) 100 + ->setConduitTypeDescription(pht('New event icon.')) 101 + ->setValue($object->getIcon()), 73 102 ); 74 103 75 104 return $fields;
+5 -16
src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
··· 40 40 $event->setIsStub(0); 41 41 42 42 $invitees = $event->getParentEvent()->getInvitees(); 43 + 44 + $new_invitees = array(); 43 45 foreach ($invitees as $invitee) { 44 46 $invitee = id(new PhabricatorCalendarEventInvitee()) 45 47 ->setEventPHID($event->getPHID()) ··· 47 49 ->setInviterPHID($invitee->getInviterPHID()) 48 50 ->setStatus($invitee->getStatus()) 49 51 ->save(); 52 + 53 + $new_invitees[] = $invitee; 50 54 } 51 55 52 56 $event->save(); 57 + $event->attachInvitees($new_invitees); 53 58 } 54 59 55 60 public function getTransactionTypes() { ··· 67 72 $types[] = PhabricatorCalendarEventTransaction::TYPE_RECURRING; 68 73 $types[] = PhabricatorCalendarEventTransaction::TYPE_FREQUENCY; 69 74 $types[] = PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE; 70 - $types[] = PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT; 71 - $types[] = PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX; 72 75 73 76 $types[] = PhabricatorTransactions::TYPE_COMMENT; 74 77 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; ··· 87 90 return $object->getRecurrenceFrequency(); 88 91 case PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE: 89 92 return $object->getRecurrenceEndDate(); 90 - case PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT: 91 - return $object->getInstanceOfEventPHID(); 92 - case PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX: 93 - return $object->getSequenceIndex(); 94 93 case PhabricatorCalendarEventTransaction::TYPE_NAME: 95 94 return $object->getName(); 96 95 case PhabricatorCalendarEventTransaction::TYPE_START_DATE: ··· 131 130 switch ($xaction->getTransactionType()) { 132 131 case PhabricatorCalendarEventTransaction::TYPE_RECURRING: 133 132 case PhabricatorCalendarEventTransaction::TYPE_FREQUENCY: 134 - case PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT: 135 - case PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX: 136 133 case PhabricatorCalendarEventTransaction::TYPE_NAME: 137 134 case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION: 138 135 case PhabricatorCalendarEventTransaction::TYPE_CANCEL: ··· 159 156 return $object->setIsRecurring($xaction->getNewValue()); 160 157 case PhabricatorCalendarEventTransaction::TYPE_FREQUENCY: 161 158 return $object->setRecurrenceFrequency($xaction->getNewValue()); 162 - case PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT: 163 - return $object->setInstanceOfEventPHID($xaction->getNewValue()); 164 - case PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX: 165 - return $object->setSequenceIndex($xaction->getNewValue()); 166 159 case PhabricatorCalendarEventTransaction::TYPE_NAME: 167 160 $object->setName($xaction->getNewValue()); 168 161 return; ··· 202 195 case PhabricatorCalendarEventTransaction::TYPE_RECURRING: 203 196 case PhabricatorCalendarEventTransaction::TYPE_FREQUENCY: 204 197 case PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE: 205 - case PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT: 206 - case PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX: 207 198 case PhabricatorCalendarEventTransaction::TYPE_NAME: 208 199 case PhabricatorCalendarEventTransaction::TYPE_START_DATE: 209 200 case PhabricatorCalendarEventTransaction::TYPE_END_DATE: ··· 253 244 case PhabricatorCalendarEventTransaction::TYPE_RECURRING: 254 245 case PhabricatorCalendarEventTransaction::TYPE_FREQUENCY: 255 246 case PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE: 256 - case PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT: 257 - case PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX: 258 247 case PhabricatorCalendarEventTransaction::TYPE_START_DATE: 259 248 case PhabricatorCalendarEventTransaction::TYPE_END_DATE: 260 249 case PhabricatorCalendarEventTransaction::TYPE_CANCEL:
-15
src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
··· 16 16 const TYPE_FREQUENCY = 'calendar.frequency'; 17 17 const TYPE_RECURRENCE_END_DATE = 'calendar.recurrenceenddate'; 18 18 19 - const TYPE_INSTANCE_OF_EVENT = 'calendar.instanceofevent'; 20 - const TYPE_SEQUENCE_INDEX = 'calendar.sequenceindex'; 21 - 22 19 const MAILTAG_RESCHEDULE = 'calendar-reschedule'; 23 20 const MAILTAG_CONTENT = 'calendar-content'; 24 21 const MAILTAG_OTHER = 'calendar-other'; ··· 48 45 case self::TYPE_RECURRING: 49 46 case self::TYPE_FREQUENCY: 50 47 case self::TYPE_RECURRENCE_END_DATE: 51 - case self::TYPE_INSTANCE_OF_EVENT: 52 - case self::TYPE_SEQUENCE_INDEX: 53 48 $phids[] = $this->getObjectPHID(); 54 49 break; 55 50 case self::TYPE_INVITE: ··· 75 70 case self::TYPE_RECURRING: 76 71 case self::TYPE_FREQUENCY: 77 72 case self::TYPE_RECURRENCE_END_DATE: 78 - case self::TYPE_INSTANCE_OF_EVENT: 79 - case self::TYPE_SEQUENCE_INDEX: 80 73 return ($old === null); 81 74 } 82 75 return parent::shouldHide(); ··· 95 88 case self::TYPE_RECURRING: 96 89 case self::TYPE_FREQUENCY: 97 90 case self::TYPE_RECURRENCE_END_DATE: 98 - case self::TYPE_INSTANCE_OF_EVENT: 99 - case self::TYPE_SEQUENCE_INDEX: 100 91 return 'fa-pencil'; 101 92 break; 102 93 case self::TYPE_INVITE: ··· 283 274 $text = pht('%s has changed the recurrence end date of this event.', 284 275 $this->renderHandleLink($author_phid)); 285 276 return $text; 286 - case self::TYPE_INSTANCE_OF_EVENT: 287 - case self::TYPE_SEQUENCE_INDEX: 288 - return pht('Recurring event has been updated.'); 289 277 } 290 278 return parent::getTitle(); 291 279 } ··· 501 489 $this->renderHandleLink($object_phid), 502 490 $new); 503 491 return $text; 504 - case self::TYPE_INSTANCE_OF_EVENT: 505 - case self::TYPE_SEQUENCE_INDEX: 506 - return pht('Recurring event has been updated.'); 507 492 } 508 493 509 494 return parent::getTitleForFeed();