From: Michael J. Rubinsky Date: Fri, 2 Jul 2010 20:52:44 +0000 (-0400) Subject: Add deleted recurrences as exceptions as well. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5e9d5cbaf49d9e290c2111a99fe4444066c23e3e;p=horde.git Add deleted recurrences as exceptions as well. --- diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Exception.php b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Exception.php index 09db9dfbe..130a2cd28 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Exception.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Exception.php @@ -45,7 +45,11 @@ class Horde_ActiveSync_Message_Exception extends Horde_ActiveSync_Message_Appoin } /** - * Exception start time + * Exception start time. This field seems to have different usages depending + * on if this is a command request from the client or from the server. If + * it's part of a request from client, then it represents the date of the + * exception that is to be deleted. If it is from server, it represents the + * date of the *original* recurring event. * * @return Horde_Date The exception's start time */ diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index cd9b3510c..096165a6c 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -1064,13 +1064,13 @@ abstract class Kronolith_Event /* Recurrence */ if ($rrule = $message->getRecurrence()) { - $this->recurrence = $rrule; /* Exceptions */ /* Since AS keeps exceptions as part of the original event, we need to * delete all existing exceptions and re-create them. The only drawback * to this is that the UIDs will change. */ + $this->recurrence = $rrule; if (!empty($this->uid)) { $kronolith_driver = Kronolith::getDriver(null, $this->calendar); $search = new StdClass(); @@ -1102,7 +1102,11 @@ abstract class Kronolith_Event $event->exceptionoriginaldate = $original; $event->initialized = true; $event->save(); - } + } else { + /* For exceptions that are deletions, just add the exception */ + $exceptiondt = $rule->getExceptionStartTime(); + $this->recurrence->addException($exceptiondt->format('Y'), $exceptiondt->format('m'), $exceptiondt->format('d')); + } } } @@ -1205,7 +1209,7 @@ abstract class Kronolith_Event array('start' => $exception->start, 'end' => $exception->end, 'allday' => $exception->isAllDay())); - /* The start time of the original recurring event */ + /* The start time of the *original* recurring event */ $e->setExceptionStartTime($exception->exceptionoriginaldate); $originaldate = $exception->exceptionoriginaldate->format('Ymd'); $key = array_search($originaldate, $exceptions);