Allow passing the $coverEvents parameter from the listEvents API call
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 2 Apr 2010 18:52:21 +0000 (14:52 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 2 Apr 2010 18:54:15 +0000 (14:54 -0400)
kronolith/lib/Api.php
kronolith/lib/Kronolith.php

index c13b29b..6602a82 100644 (file)
@@ -1017,13 +1017,15 @@ class Kronolith_Api extends Horde_Registry_Api
      * @param boolean $hideExceptions  Hide events that represent exceptions to
      *                                 a recurring event (events with baseid
      *                                 set)?
+     * @param boolean $coverDates      Add multi-day events to all dates?
      *
      * @return array  A list of event hashes.
      * @throws Kronolith_Exception
      */
     public function listEvents($startstamp = null, $endstamp = null,
         $calendars = null, $showRecurrence = true,
-        $alarmsOnly = false, $showRemote = true, $hideExceptions = false)
+        $alarmsOnly = false, $showRemote = true, $hideExceptions = false,
+        $coverDates = true)
     {
         if (!isset($calendars)) {
             $calendars = array($GLOBALS['prefs']->getValue('default_share'));
@@ -1044,7 +1046,8 @@ class Kronolith_Api extends Horde_Registry_Api
             $showRecurrence,
             $alarmsOnly,
             $showRemote,
-            $hideExceptions);
+            $hideExceptions,
+            $coverDates);
     }
 
     /**
index 9170948..b531df2 100644 (file)
@@ -418,6 +418,8 @@ class Kronolith
         if ($calendar) {
             $driver = explode('|', $calendar, 2);
             $calendars = array($driver[0] => array($driver[1]));
+        } elseif (!empty($query->calendars)) {
+            $calendars = $query->calendars;
         } else {
             $calendars = array(
                 Horde_String::ucfirst($GLOBALS['conf']['calendar']['driver']) => $GLOBALS['display_calendars'],
@@ -463,7 +465,7 @@ class Kronolith
     public static function listEvents($startDate, $endDate, $calendars = null,
                                       $showRecurrence = true,
                                       $alarmsOnly = false, $showRemote = true,
-                                      $hideExceptions = false)
+                                      $hideExceptions = false, $coverDates = true)
     {
         $results = array();
 
@@ -475,7 +477,7 @@ class Kronolith
         foreach ($calendars as $calendar) {
             $driver->open($calendar);
             $events = $driver->listEvents($startDate, $endDate, $showRecurrence,
-                                          $alarmsOnly, false, true,
+                                          $alarmsOnly, false, $coverDates,
                                           $hideExceptions);
             
             self::mergeEvents($results, $events);