From: Jan Schneider Date: Fri, 29 Jan 2010 15:10:25 +0000 (+0100) Subject: Fix exporting all events. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=02c04fe3d187a8b2ce6ba3691b4e02960161b838;p=horde.git Fix exporting all events. --- diff --git a/kronolith/data.php b/kronolith/data.php index ae0a399fd..eb8132982 100644 --- a/kronolith/data.php +++ b/kronolith/data.php @@ -100,7 +100,7 @@ case 'export': if ($kronolith_driver->calendar != $cal) { $kronolith_driver->open($cal); } - $events[$cal] = $kronolith_driver->listEvents($start, $end); + $events[$cal] = $kronolith_driver->listEvents($start, $end, false, false, false, false); } if (!$events) { diff --git a/kronolith/lib/Driver/Holidays.php b/kronolith/lib/Driver/Holidays.php index a8a7a3c07..16b87396a 100644 --- a/kronolith/lib/Driver/Holidays.php +++ b/kronolith/lib/Driver/Holidays.php @@ -34,12 +34,14 @@ class Kronolith_Driver_Holidays extends Kronolith_Driver * effect in this driver. * @param boolean $json Store the results of the events' * toJson() method? + * @param boolean $coverDates Whether to add the events to all days + * that they cover. * * @return array Events in the given time range. */ public function listEvents($startDate = null, $endDate = null, $showRecurrence = false, $hasAlarm = false, - $json = false) + $json = false, $coverDates = true) { if (!class_exists('Date_Holidays')) { Horde::logMessage('Support for Date_Holidays has been enabled but the package seems to be missing.', @@ -80,7 +82,7 @@ class Kronolith_Driver_Holidays extends Kronolith_Driver $events = $this->_getEvents($dh, $startDate, $endDate); foreach ($events as $event) { Kronolith::addEvents($results, $event, $startDate, $endDate, - $showRecurrence, $json); + $showRecurrence, $json, $coverDates); } } diff --git a/kronolith/lib/Driver/Horde.php b/kronolith/lib/Driver/Horde.php index ffa4ca339..1c455bb47 100644 --- a/kronolith/lib/Driver/Horde.php +++ b/kronolith/lib/Driver/Horde.php @@ -46,13 +46,15 @@ class Kronolith_Driver_Horde extends Kronolith_Driver * @param boolean $hasAlarm Only return events with alarms? * @param boolean $json Store the results of the events' * toJson() method? + * @param boolean $coverDates Whether to add the events to all days + * that they cover. * * @return array Events in the given time range. * @throws Horde_Exception */ public function listEvents($startDate = null, $endDate = null, $showRecurrence = false, $hasAlarm = false, - $json = false) + $json = false, $coverDates = true) { list($this->api, $category) = explode('/', $this->calendar, 2); if (!$this->_params['registry']->hasMethod($this->api . '/listTimeObjects')) { @@ -98,7 +100,7 @@ class Kronolith_Driver_Horde extends Kronolith_Driver } Kronolith::addEvents($results, $event, $startDate, - $endDate, $showRecurrence, $json); + $endDate, $showRecurrence, $json, $coverDates); } return $results; diff --git a/kronolith/lib/Driver/Ical.php b/kronolith/lib/Driver/Ical.php index f4228b286..27ce822c7 100644 --- a/kronolith/lib/Driver/Ical.php +++ b/kronolith/lib/Driver/Ical.php @@ -65,12 +65,14 @@ class Kronolith_Driver_Ical extends Kronolith_Driver * @param boolean $hasAlarm Only return events with alarms? * @param boolean $json Store the results of the events' * toJson() method? + * @param boolean $coverDates Whether to add the events to all days + * that they cover. * * @return array Events in the given time range. */ public function listEvents($startDate = null, $endDate = null, $showRecurrence = false, $hasAlarm = false, - $json = false) + $json = false, $coverDates = true) { $iCal = $this->getRemoteCalendar(); if (is_a($iCal, 'PEAR_Error')) { @@ -145,7 +147,7 @@ class Kronolith_Driver_Ical extends Kronolith_Driver $events[$key]->recurrence->addException(date('Y', $timestamp), date('m', $timestamp), date('d', $timestamp)); } Kronolith::addEvents($results, $event, $startDate, $endDate, - $showRecurrence, $json); + $showRecurrence, $json, $coverDates); } return $results; diff --git a/kronolith/lib/Driver/Kolab.php b/kronolith/lib/Driver/Kolab.php index 0809a94f6..0826b3d09 100644 --- a/kronolith/lib/Driver/Kolab.php +++ b/kronolith/lib/Driver/Kolab.php @@ -214,12 +214,14 @@ class Kronolith_Driver_Kolab extends Kronolith_Driver * @param boolean $hasAlarm Only return events with alarms? * @param boolean $json Store the results of the events' * toJson() method? + * @param boolean $coverDates Whether to add the events to all days + * that they cover. * * @return array Events in the given time range. */ public function listEvents($startDate = null, $endDate = null, $showRecurrence = false, $hasAlarm = false, - $json = false) + $json = false, $coverDates = true) { $result = $this->synchronize(); if (is_a($result, 'PEAR_Error')) { @@ -265,7 +267,7 @@ class Kronolith_Driver_Kolab extends Kronolith_Driver } Kronolith::addEvents($events, $event, $startDate, $endDate, - $showRecurrence, $json); + $showRecurrence, $json, $coverDates); } return $events; diff --git a/kronolith/lib/Driver/Sql.php b/kronolith/lib/Driver/Sql.php index 760543f60..bff89c038 100644 --- a/kronolith/lib/Driver/Sql.php +++ b/kronolith/lib/Driver/Sql.php @@ -263,12 +263,14 @@ class Kronolith_Driver_Sql extends Kronolith_Driver * @param boolean $hasAlarm Only return events with alarms? * @param boolean $json Store the results of the events' * toJson() method? + * @param boolean $coverDates Whether to add the events to all days + * that they cover. * * @return array Events in the given time range. */ public function listEvents($startDate = null, $endDate = null, $showRecurrence = false, $hasAlarm = false, - $json = false) + $json = false, $coverDates = true) { if (!is_null($startDate)) { $startDate = clone $startDate; @@ -289,7 +291,7 @@ class Kronolith_Driver_Sql extends Kronolith_Driver $results = array(); foreach ($events as $id) { Kronolith::addEvents($results, $this->getEvent($id), $startDate, - $endDate, $showRecurrence, $json); + $endDate, $showRecurrence, $json, $coverDates); } return $results; diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 2e450da78..86b89bc6c 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -526,8 +526,7 @@ class Kronolith * @access private */ public static function addEvents(&$results, &$event, $startDate, $endDate, - $showRecurrence, $json, - $coverDates = true) + $showRecurrence, $json, $coverDates = true) { if ($event->recurs() && $showRecurrence) { /* Recurring Event. */