From 0b96631cd43078ce12e9704e0e0c40f66c9dc8a1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 12 Sep 2011 11:04:48 +0000 Subject: [PATCH] Do NOT move start- and end-date, to the earliest exception, as they will NOT be found in CalDAV or ActiveSync, because we only recognice recuring events which start before or in the current timerange and end in or after it or have no end-date. --> give an error message, as it is a debuging/support nightmare, if this gets silently fixed when reading events. No idea how this situation (exceptions before startdate) can be created anyway. --- calendar/inc/class.calendar_so.inc.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index 11390c0cf0..aa3bd8f92d 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -200,11 +200,17 @@ class calendar_so sort($event['recur_exception']); if ($event['recur_exception'][0] < $event['start']) { - // leading exceptions => move start and end - $event['end'] -= $event['start'] - $event['recur_exception'][0]; - $event['start'] = $event['recur_exception'][0]; + /* Do NOT move start- and end-date, to the earliest exception, as they will NOT be found in CalDAV or ActiveSync, because + * we only recognice recuring events which start before or in the current timerange and end in or after it or have no end-date. + * --> give an error message, as it is a debuging/support nightmare, if this get's silently fixed when reading events. + * No idea how this situation (exceptions before startdate) can be created anyway. + * + * $event['end'] -= $event['start'] - $event['recur_exception'][0]; + * $event['start'] = $event['recur_exception'][0]; + */ + error_log(__METHOD__."() recuring event #$event[id]: $event[title] has exceptions before it's startdate ".date('Y-m-d H:i:s',$event['start'])); } - } + }//*/ } // check if we have a real recurance, if not set $recur_date=0