diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 0ab9323277..20839ae549 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -899,7 +899,7 @@ class calendar_bo if (!$start) $start = $event['start']; $events = array(); - error_log(__METHOD__ . " Horizon config: {$this->config['horizont']}"); + $this->insert_all_recurrences($event,$start,$this->date2usertime($this->config['horizont']),$events); $exceptions = array(); @@ -1115,9 +1115,6 @@ class calendar_bo $event_start_ts = $this->date2ts($event['start']); $event_length = $this->date2ts($event['end']) - $event_start_ts; // we use a constant event-length, NOT a constant end-time! - error_log(__METHOD__ . ':'.__LINE__ ." Recurrence end date: " . Api\DateTime::to($event['recur_enddate'], Api\DateTime::DATABASE)); - error_log(__METHOD__ . ':'.__LINE__ ." Event end date: " . Api\DateTime::to($event['end'], Api\DateTime::DATABASE)); - error_log(__METHOD__ . ':'.__LINE__ ." Recurrence horizon: " . Api\DateTime::to($end, Api\DateTime::DATABASE)); // if $end is before recur_enddate, use it instead if (!$event['recur_enddate'] || $this->date2ts($event['recur_enddate']) > $this->date2ts($end)) { @@ -1128,15 +1125,11 @@ class calendar_bo $event['recur_enddate'] = is_a($event['recur_enddate'],'DateTime') ? $event['recur_enddate'] : new Api\DateTime($event['recur_enddate'], calendar_timezones::DateTimeZone($event['tzid'])); - error_log(__METHOD__ . ':'.__LINE__ ." Recurrence end date: " . Api\DateTime::to($event['recur_enddate'], Api\DateTime::DATABASE)); + // unset exceptions, as we need to add them as recurrence too, but marked as exception unset($event['recur_exception']); // loop over all recurrences and insert them, if they are after $start $rrule = calendar_rrule::event2rrule($event, !$event['whole_day'], Api\DateTime::$user_timezone->getName()); // true = we operate in usertime, like the rest of calendar_bo - $rrule->rewind(); - error_log(__METHOD__ . ' rrule: ' . $rrule . ' current: ' . $rrule->current()); - foreach($rrule as $time) {error_log($time);}; - $rrule->rewind(); foreach($rrule as $time) { $time->setUser(); // $time is in timezone of event, convert it to usertime used here diff --git a/calendar/setup/default_records.inc.php b/calendar/setup/default_records.inc.php index 091793e542..e9c0f24349 100644 --- a/calendar/setup/default_records.inc.php +++ b/calendar/setup/default_records.inc.php @@ -24,6 +24,7 @@ foreach(array( } // Start with at a month, gets updated later +// Without this, recurrences fail until it's set EGroupware\Api\Config::save_value('horizont', time()+31*24*60*60,'calendar'); // import timezone data diff --git a/calendar/tests/TimezoneTest.php b/calendar/tests/TimezoneTest.php index 2a5de082f7..8e02c69394 100644 --- a/calendar/tests/TimezoneTest.php +++ b/calendar/tests/TimezoneTest.php @@ -48,7 +48,6 @@ class TimezoneTest extends \EGroupware\Api\AppTest { //$this->mockTracking($this->bo, 'calendar_tracking'); $this->recur_end = new Api\DateTime(mktime(0,0,0,date('m'), date('d') + static::RECUR_DAYS, date('Y'))); - error_log("Recurrence end date: " . $this->recur_end . " (" . new Api\DateTime() . ' + ' . static::RECUR_DAYS . ' days)'); } public function tearDown() @@ -298,7 +297,7 @@ class TimezoneTest extends \EGroupware\Api\AppTest { } } while ($event_index < count($tz_list)); - /* one specific test */ + /* one specific test $tz_combos = array(array( 'client' => 'Europe/Berlin', 'server' => 'Pacific/Tahiti', @@ -317,7 +316,6 @@ class TimezoneTest extends \EGroupware\Api\AppTest { */ protected function makeEvent($timezones, $times, $whole_day = false) { - error_log($this->tzString($timezones)); $event = array( 'title' => ($whole_day ? 'Whole day ' : '')."Test for " . $this->tzString($timezones), 'description' => ($whole_day ? 'Whole day ' : '').'Test for test ' . $this->getName() . ' ' . $this->tzString($timezones), @@ -331,8 +329,6 @@ class TimezoneTest extends \EGroupware\Api\AppTest { $GLOBALS['egw_info']['user']['account_id'] => 'A' ) ); - error_log(__METHOD__ . ':'.__LINE__ ." Event end date: " . Api\DateTime::to($event['end'], Api\DateTime::DATABASE)); - error_log(__METHOD__ . ':'.__LINE__ ." Recurrence end date: " . Api\DateTime::to($event['recur_enddate'], Api\DateTime::DATABASE)); return $event; }