From 3d40a5871dd277f8536b3ebeaae72e2bb26e97f0 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Fri, 29 May 2015 13:58:53 -0700 Subject: [PATCH] Ghost events should provide a link to original event Summary: Closes T8356, Ghost events should provide a link to original event Test Plan: Open an instance at /calendar/event/{id}/{index}. It should have a link to /calendar/event/{id}. Original recurring event should not link to itself. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T8356 Differential Revision: https://secure.phabricator.com/D13068 --- .../controller/PhabricatorCalendarEventViewController.php | 7 ++++++- .../calendar/storage/PhabricatorCalendarEvent.php | 4 ++-- .../storage/PhabricatorCalendarEventTransaction.php | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php index c6bb1a5ae8..07f2762f63 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php @@ -218,7 +218,12 @@ final class PhabricatorCalendarEventViewController if ($event->getIsRecurring()) { $properties->addProperty( pht('Recurs'), - idx($event->getRecurrenceFrequency(), 'rule')); + ucwords(idx($event->getRecurrenceFrequency(), 'rule'))); + if ($event->getIsGhostEvent()) { + $properties->addProperty( + pht('Recurrence of Event'), + $viewer->renderHandle($event->getInstanceOfEventPHID())); + } } $properties->addProperty( diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php index 5110974306..3207e9897f 100644 --- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php +++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php @@ -288,8 +288,8 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO ->setIsGhostEvent(true) ->setDateFrom($date) ->setDateTo($date + $duration) - ->setIsRecurring(false) - ->setRecurrenceFrequency(null) + ->setIsRecurring(true) + ->setRecurrenceFrequency($this->recurrenceFrequency) ->setInstanceOfEventPHID($this->getPHID()) ->setSequenceIndex($sequence_index) ->setEditPolicy($edit_policy); diff --git a/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php b/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php index 64656b48e4..2d24281562 100644 --- a/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php +++ b/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php @@ -393,8 +393,6 @@ final class PhabricatorCalendarEventTransaction $added = array(); $uninvited = array(); - // $event = $this->renderHandleLink($object_phid); - foreach ($new as $phid => $status) { if ($status == PhabricatorCalendarEventInvitee::STATUS_INVITED || $status == PhabricatorCalendarEventInvitee::STATUS_ATTENDING) {