Remove debug

This commit is contained in:
nathangray 2017-10-23 17:56:43 +02:00
parent 1d98f0b2ab
commit b2f2acc38c
3 changed files with 4 additions and 14 deletions

View File

@ -899,7 +899,7 @@ class calendar_bo
if (!$start) $start = $event['start']; if (!$start) $start = $event['start'];
$events = array(); $events = array();
error_log(__METHOD__ . " Horizon config: {$this->config['horizont']}");
$this->insert_all_recurrences($event,$start,$this->date2usertime($this->config['horizont']),$events); $this->insert_all_recurrences($event,$start,$this->date2usertime($this->config['horizont']),$events);
$exceptions = array(); $exceptions = array();
@ -1115,9 +1115,6 @@ class calendar_bo
$event_start_ts = $this->date2ts($event['start']); $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! $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 $end is before recur_enddate, use it instead
if (!$event['recur_enddate'] || $this->date2ts($event['recur_enddate']) > $this->date2ts($end)) 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'] = is_a($event['recur_enddate'],'DateTime') ?
$event['recur_enddate'] : $event['recur_enddate'] :
new Api\DateTime($event['recur_enddate'], calendar_timezones::DateTimeZone($event['tzid'])); 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 exceptions, as we need to add them as recurrence too, but marked as exception
unset($event['recur_exception']); unset($event['recur_exception']);
// loop over all recurrences and insert them, if they are after $start // 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 = 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) foreach($rrule as $time)
{ {
$time->setUser(); // $time is in timezone of event, convert it to usertime used here $time->setUser(); // $time is in timezone of event, convert it to usertime used here

View File

@ -24,6 +24,7 @@ foreach(array(
} }
// Start with at a month, gets updated later // 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'); EGroupware\Api\Config::save_value('horizont', time()+31*24*60*60,'calendar');
// import timezone data // import timezone data

View File

@ -48,7 +48,6 @@ class TimezoneTest extends \EGroupware\Api\AppTest {
//$this->mockTracking($this->bo, 'calendar_tracking'); //$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'))); $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() public function tearDown()
@ -298,7 +297,7 @@ class TimezoneTest extends \EGroupware\Api\AppTest {
} }
} while ($event_index < count($tz_list)); } while ($event_index < count($tz_list));
/* one specific test */ /* one specific test
$tz_combos = array(array( $tz_combos = array(array(
'client' => 'Europe/Berlin', 'client' => 'Europe/Berlin',
'server' => 'Pacific/Tahiti', 'server' => 'Pacific/Tahiti',
@ -317,7 +316,6 @@ class TimezoneTest extends \EGroupware\Api\AppTest {
*/ */
protected function makeEvent($timezones, $times, $whole_day = false) protected function makeEvent($timezones, $times, $whole_day = false)
{ {
error_log($this->tzString($timezones));
$event = array( $event = array(
'title' => ($whole_day ? 'Whole day ' : '')."Test for " . $this->tzString($timezones), 'title' => ($whole_day ? 'Whole day ' : '')."Test for " . $this->tzString($timezones),
'description' => ($whole_day ? 'Whole day ' : '').'Test for test ' . $this->getName() . ' ' . $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' $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; return $event;
} }