@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.

Add helper method on event object to determine if event is the parent of a recurrence.

Summary: Ref T8472, Add helper method on event object to determine if event is the parent of a recurrence.

Test Plan: No user facing change.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T8472

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

+21 -8
+3 -4
src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php
··· 42 42 43 43 $is_cancelled = $event->getIsCancelled(); 44 44 $is_parent_cancelled = $event->getIsParentCancelled(); 45 - $is_recurring = $event->getIsRecurring(); 46 - $instance_of = $event->getInstanceOfEventPHID(); 45 + $is_parent = $event->getIsRecurrenceParent(); 47 46 48 47 $validation_exception = null; 49 48 ··· 86 85 cancelled recurring event.'); 87 86 $cancel = pht('Cancel'); 88 87 $submit = null; 89 - } else if ($is_recurring && !$instance_of) { 88 + } else if ($is_parent) { 90 89 $title = pht('Reinstate Recurrence'); 91 90 $paragraph = pht('Reinstate the entire series 92 91 of recurring events?'); ··· 105 104 of a recurring event.'); 106 105 $cancel = pht('Don\'t Cancel Instance'); 107 106 $submit = pht('Cancel Instance'); 108 - } else if ($is_recurring && !$instance_of) { 107 + } else if ($is_parent) { 109 108 $title = pht('Cancel Recurrence'); 110 109 $paragraph = pht('Cancel the entire series 111 110 of recurring events?');
+4 -4
src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
··· 164 164 $index = $event->getSequenceIndex(); 165 165 $edit_label = pht('Edit This Instance'); 166 166 $edit_uri = "event/edit/{$id}/{$index}/"; 167 - } else if ($event->getInstanceOfEventPHID() && !$event->getIsGhostEvent()) { 167 + } else if ($event->getIsRecurrenceException()) { 168 168 $edit_label = pht('Edit This Instance'); 169 169 $edit_uri = "event/edit/{$id}/"; 170 - } else if (!$event->getIsRecurring()) { 170 + } else if (!$event->getIsRecurrenceParent()) { 171 171 $edit_label = pht('Edit'); 172 172 $edit_uri = "event/edit/{$id}/"; 173 173 } ··· 208 208 $reinstate_label = pht('Reinstate This Instance'); 209 209 $cancel_disabled = (!$can_edit || $can_reinstate); 210 210 $cancel_uri = $this->getApplicationURI("event/cancel/{$id}/{$index}/"); 211 - } else if ($event->getInstanceOfEventPHID()) { 211 + } else if ($event->getIsRecurrenceException()) { 212 212 $can_reinstate = $event->getIsParentCancelled(); 213 213 $cancel_label = pht('Cancel This Instance'); 214 214 $reinstate_label = pht('Reinstate This Instance'); 215 215 $cancel_disabled = (!$can_edit || $can_reinstate); 216 - } else if ($event->getIsRecurring()) { 216 + } else if ($event->getIsRecurrenceParent()) { 217 217 $cancel_label = pht('Cancel Recurrence'); 218 218 $reinstate_label = pht('Reinstate Recurrence'); 219 219 $cancel_disabled = !$can_edit;
+14
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 347 347 return $this->isCancelled; 348 348 } 349 349 350 + public function getIsRecurrenceParent() { 351 + if ($this->isRecurring && !$this->instanceOfEventPHID) { 352 + return true; 353 + } 354 + return false; 355 + } 356 + 357 + public function getIsRecurrenceException() { 358 + if ($this->instanceOfEventPHID && !$this->isGhostEvent) { 359 + return true; 360 + } 361 + return false; 362 + } 363 + 350 364 public function getIsParentCancelled() { 351 365 if ($this->instanceOfEventPHID == null) { 352 366 return false;