Fix exporting all events.
authorJan Schneider <jan@horde.org>
Fri, 29 Jan 2010 15:10:25 +0000 (16:10 +0100)
committerJan Schneider <jan@horde.org>
Fri, 29 Jan 2010 15:13:07 +0000 (16:13 +0100)
kronolith/data.php
kronolith/lib/Driver/Holidays.php
kronolith/lib/Driver/Horde.php
kronolith/lib/Driver/Ical.php
kronolith/lib/Driver/Kolab.php
kronolith/lib/Driver/Sql.php
kronolith/lib/Kronolith.php

index ae0a399..eb81329 100644 (file)
@@ -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) {
index a8a7a3c..16b8739 100644 (file)
@@ -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);
             }
         }
 
index ffa4ca3..1c455bb 100644 (file)
@@ -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;
index f4228b2..27ce822 100644 (file)
@@ -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;
index 0809a94..0826b3d 100644 (file)
@@ -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;
index 760543f..bff89c0 100644 (file)
@@ -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;
index 2e450da..86b89bc 100644 (file)
@@ -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. */