summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-01-21 18:02:10 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-01-21 18:02:10 (GMT)
commit4aecc97621eb46d90c0ff63e531169b863905759 (patch)
treee4aab927d4cce68cda01ebd1569d95747f69aade
parentdb2e01915688fae75bee67bde760445bc6daf4c8 (diff)
downloadkolab-freebusy-4aecc97621eb46d90c0ff63e531169b863905759.tar.gz
Set event UID to make computation of recurring events work (#4290); improved debug logging for better observation
-rw-r--r--lib/Kolab/FreeBusy/SourceIMAP.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Kolab/FreeBusy/SourceIMAP.php b/lib/Kolab/FreeBusy/SourceIMAP.php
index 5a4bd43..bca241f 100644
--- a/lib/Kolab/FreeBusy/SourceIMAP.php
+++ b/lib/Kolab/FreeBusy/SourceIMAP.php
@@ -118,8 +118,11 @@ class SourceIMAP extends Source
$calendar = VObject\Component::create('VCALENDAR');
$seen = array();
+ $log->addInfo("Getting events from IMAP in range", array($dtstart->format('c'), $dtend->format('c')));
+
$query = array(array('dtstart','<=',$dtend), array('dtend','>=',$dtstart));
foreach ($folders as $folder) {
+ $count = 0;
$log->debug('Reading Kolab folder: ' . $folder->name, $folder->get_folder_info());
// skip other user's shared calendars
@@ -168,9 +171,6 @@ class SourceIMAP extends Source
}
}
- // copied from libvcalendar::_to_ical()
- $ve = VObject\Component::create('VEVENT');
-
// translate all-day dates into absolute UTC times
// FIXME: use server timezone?
if ($event['allday']) {
@@ -192,6 +192,10 @@ class SourceIMAP extends Source
continue;
}
+ // copied from libvcalendar::_to_ical()
+ $ve = VObject\Component::create('VEVENT');
+ $ve->UID = $event['uid'];
+
if (!empty($event['start']))
$ve->add(\libvcalendar::datetime_prop('DTSTART', $event['start'], false, false));
if (!empty($event['end']))
@@ -236,7 +240,12 @@ class SourceIMAP extends Source
// append to vcalendar container
$calendar->add($ve);
+ $count++;
+
+ $log->debug("Adding event for processing:\n" . $ve->serialize());
}
+
+ $log->addInfo("Added $count events from folder" . $folder->name);
}
$this->imap_disconnect($imap, $config, $folders);