Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15332770
D13221.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13221.diff
View Options
diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php b/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php
@@ -42,8 +42,7 @@
$is_cancelled = $event->getIsCancelled();
$is_parent_cancelled = $event->getIsParentCancelled();
- $is_recurring = $event->getIsRecurring();
- $instance_of = $event->getInstanceOfEventPHID();
+ $is_parent = $event->getIsRecurrenceParent();
$validation_exception = null;
@@ -86,7 +85,7 @@
cancelled recurring event.');
$cancel = pht('Cancel');
$submit = null;
- } else if ($is_recurring && !$instance_of) {
+ } else if ($is_parent) {
$title = pht('Reinstate Recurrence');
$paragraph = pht('Reinstate the entire series
of recurring events?');
@@ -105,7 +104,7 @@
of a recurring event.');
$cancel = pht('Don\'t Cancel Instance');
$submit = pht('Cancel Instance');
- } else if ($is_recurring && !$instance_of) {
+ } else if ($is_parent) {
$title = pht('Cancel Recurrence');
$paragraph = pht('Cancel the entire series
of recurring events?');
diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
@@ -164,10 +164,10 @@
$index = $event->getSequenceIndex();
$edit_label = pht('Edit This Instance');
$edit_uri = "event/edit/{$id}/{$index}/";
- } else if ($event->getInstanceOfEventPHID() && !$event->getIsGhostEvent()) {
+ } else if ($event->getIsRecurrenceException()) {
$edit_label = pht('Edit This Instance');
$edit_uri = "event/edit/{$id}/";
- } else if (!$event->getIsRecurring()) {
+ } else if (!$event->getIsRecurrenceParent()) {
$edit_label = pht('Edit');
$edit_uri = "event/edit/{$id}/";
}
@@ -208,12 +208,12 @@
$reinstate_label = pht('Reinstate This Instance');
$cancel_disabled = (!$can_edit || $can_reinstate);
$cancel_uri = $this->getApplicationURI("event/cancel/{$id}/{$index}/");
- } else if ($event->getInstanceOfEventPHID()) {
+ } else if ($event->getIsRecurrenceException()) {
$can_reinstate = $event->getIsParentCancelled();
$cancel_label = pht('Cancel This Instance');
$reinstate_label = pht('Reinstate This Instance');
$cancel_disabled = (!$can_edit || $can_reinstate);
- } else if ($event->getIsRecurring()) {
+ } else if ($event->getIsRecurrenceParent()) {
$cancel_label = pht('Cancel Recurrence');
$reinstate_label = pht('Reinstate Recurrence');
$cancel_disabled = !$can_edit;
diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -347,6 +347,20 @@
return $this->isCancelled;
}
+ public function getIsRecurrenceParent() {
+ if ($this->isRecurring && !$this->instanceOfEventPHID) {
+ return true;
+ }
+ return false;
+ }
+
+ public function getIsRecurrenceException() {
+ if ($this->instanceOfEventPHID && !$this->isGhostEvent) {
+ return true;
+ }
+ return false;
+ }
+
public function getIsParentCancelled() {
if ($this->instanceOfEventPHID == null) {
return false;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 8, 8:06 PM (5 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384192
Default Alt Text
D13221.diff (3 KB)
Attached To
Mode
D13221: Add helper method on event object to determine if event is the parent of a recurrence.
Attached
Detach File
Event Timeline
Log In to Comment