}
/**
- * 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
*/
/* 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();
$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'));
+ }
}
}
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);