From 9f377914c92c4f252422eb6039ae6b4805f16077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Thu, 16 Jul 2009 19:42:50 +0000 Subject: [PATCH] fix recurrence exception issue --- calendar/inc/class.calendar_ical.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index c1bc53e8fe..9f865f89c5 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -912,13 +912,16 @@ class calendar_ical extends calendar_boupdate if (($egw_event = $this->read($event['uid'])) && $egw_event['recur_type'] != MCAL_RECUR_NONE) { - $unchanged = true; + // Same start and duration is obligatory for status only + $old_duration = $egw_event['end'] - $egw_event['start']; + $new_duration = $event['end'] - $event['start']; + $unchanged = ($event['start'] == $recur_date && $old_duration == $new_duration); foreach (array('uid','owner','title','description', 'location','priority','public','special','non_blocking') as $key) { //Horde::logMessage('importVCAL test ' .$key . ': '. $egw_event[$key] . ' == ' .$event[$key], // __FILE__, __LINE__, PEAR_LOG_DEBUG); - if (!empty($event[$key]) //|| !empty($egw_event[$key])) + if (!$unchanged && !empty($event[$key]) //|| !empty($egw_event[$key])) && $egw_event[$key] != $event[$key]) { $unchanged = false; @@ -930,7 +933,6 @@ class calendar_ical extends calendar_boupdate Horde::logMessage('importVCAL event unchanged', __FILE__, __LINE__, PEAR_LOG_DEBUG); - // We can handle this without an exception entry $recur_exceptions = array(); foreach ($egw_event['recur_exception'] as $recur_exception) { @@ -941,9 +943,10 @@ class calendar_ical extends calendar_boupdate $recur_exceptions[] = $recur_exception; } } + $egw_event['recur_exception'] = $recur_exceptions; //Horde::logMessage("importVCAL exceptions\n" . print_r($recur_exceptions, true), // __FILE__, __LINE__, PEAR_LOG_DEBUG); - $egw_event['recur_exception'] = $recur_exceptions; + $this->update($egw_event, true); // update the stati from the exception