From: Michael J. Rubinsky Date: Fri, 2 Apr 2010 18:52:21 +0000 (-0400) Subject: Allow passing the $coverEvents parameter from the listEvents API call X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=73e6273009ebaa831408ccedb93164fa241b79ab;p=horde.git Allow passing the $coverEvents parameter from the listEvents API call --- diff --git a/kronolith/lib/Api.php b/kronolith/lib/Api.php index c13b29bd8..6602a8243 100644 --- a/kronolith/lib/Api.php +++ b/kronolith/lib/Api.php @@ -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); } /** diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 917094869..b531df23c 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -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);