From b034eeac9264e7cccb3864f3fc9c8cb8e8d5f1e4 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 24 Nov 2015 18:15:11 +0000 Subject: [PATCH] Fix changing recurring end date to earlier always gave one extra recurrence --- calendar/inc/class.calendar_bo.inc.php | 3 ++- calendar/inc/class.calendar_boupdate.inc.php | 2 +- calendar/inc/class.calendar_so.inc.php | 2 +- calendar/inc/class.calendar_uiforms.inc.php | 4 ---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index f2111ae473..e8dd1b9cd3 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -800,7 +800,7 @@ class calendar_bo { $exceptions[] = egw_time::to($exception, true); // true = date } - //error_log(__METHOD__."(".array2string($event).", $start) exceptions=".array2string($exceptions)); + error_log(__METHOD__."(".array2string($event).", $start) exceptions=".array2string($exceptions)); foreach($events as $event) { $is_exception = in_array(egw_time::to($event['start'], true), $exceptions); @@ -1020,6 +1020,7 @@ class calendar_bo foreach($rrule as $time) { $time->setUser(); // $time is in timezone of event, convert it to usertime used here + error_log($time); if (($ts = $this->date2ts($time)) < $start-$event_length) { //echo "

".$time." --> ignored as $ts < $start-$event_length

\n"; diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index d09d09fb63..c43ad0bf38 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1213,7 +1213,7 @@ class calendar_boupdate extends calendar_bo $event['created'] = $this->now; $event['creator'] = $this->user; } - $set_recurrences = false; + $set_recurrences = $old_event ? $event['recur_enddate'] != $old_event['recur_enddate'] : false; $set_recurrences_start = 0; if (($cal_id = $this->so->save($event,$set_recurrences,$set_recurrences_start,0,$event['etag'])) && $set_recurrences && $event['recur_type'] != MCAL_RECUR_NONE) { diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index 231001b367..27fc3f10e0 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -1328,7 +1328,7 @@ ORDER BY cal_user_type, cal_usre_id $cal_id = (int) $event['id']; unset($event['id']); - $set_recurrences = !$cal_id && $event['recur_type'] != MCAL_RECUR_NONE; + $set_recurrences = $set_recurrences || !$cal_id && $event['recur_type'] != MCAL_RECUR_NONE; if ($event['recur_type'] != MCAL_RECUR_NONE && !(int)$event['recur_interval']) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index bdc37b22da..7c5af1e4a4 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -819,10 +819,6 @@ foreach($recur_event as $_k => $_v) error_log($_k . ': ' . array2string($_v)); $event['alarm'] = array(); } } - else if ($event['recur_enddate'] != $old_event['recur_enddate']) - { - error_log(__METHOD__ . ':'.__LINE__ . ' ' .$event['recur_enddate'] . (isset($event['recur_enddate']) ? ' SET' : ' NOT SET')); - } } else {