From: Michael J. Rubinsky Date: Sun, 26 Sep 2010 14:54:36 +0000 (-0400) Subject: Standardize on *_Api::listUids() method name for api methods that, well, return Uids. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=77e901ff8b7f1689c8336e2d5fa6d938cede86d6;p=horde.git Standardize on *_Api::listUids() method name for api methods that, well, return Uids. Kronolith_Api::listUids() functionality changed slightly with this commit - it now no longer returns events that represent exceptions, and only includes recurring events once within the requested time period. It looks like the syncml code was the only code currently calling this method, so there should be no issues with this change. For the other apps, this only represents a method name change. Bug: 9253 --- diff --git a/framework/SyncML/SyncML/Backend/Horde.php b/framework/SyncML/SyncML/Backend/Horde.php index 5c2560767..769a38be6 100644 --- a/framework/SyncML/SyncML/Backend/Horde.php +++ b/framework/SyncML/SyncML/Backend/Horde.php @@ -109,11 +109,6 @@ class SyncML_Backend_Horde extends SyncML_Backend { { global $registry; - $apimap = array('calendar' => 'listEvents', - 'contacts' => 'listContacts', - 'tasks' => 'listTasks', - 'notes' => 'listNotes'); - $adds = $mods = $dels = array(); $database = $this->_normalize($databaseURI); $slowsync = $from_ts == 0; @@ -135,10 +130,10 @@ class SyncML_Backend_Horde extends SyncML_Backend { } $start = new Horde_Date($start); $this->logMessage('Slow-syncing all events starting from ' . (string)$start, 'DEBUG'); - $data = $registry->{$database}->{$apimap[$database]}( + $data = $registry->{$database}->listUids( SyncML_Backend::getParameter($databaseURI, 'source'), $start); } else { - $data = $registry->{$database}->{$apimap[$database]}( + $data = $registry->{$database}->listUids( SyncML_Backend::getParameter($databaseURI, 'source')); } } else { diff --git a/kronolith/lib/Api.php b/kronolith/lib/Api.php index 8409f0228..e653d4a8c 100644 --- a/kronolith/lib/Api.php +++ b/kronolith/lib/Api.php @@ -437,6 +437,9 @@ class Kronolith_Api extends Horde_Registry_Api /** * Returns the ids of all the events that happen within a time period. + * Only includes recurring events once per time period, and does not include + * events that represent exceptions, making this method useful for syncing + * purposes. For more control, use the listEvents method. * * @param string $calendar The calendar to check for events. * @param object $startstamp The start of the time range. @@ -456,7 +459,14 @@ class Kronolith_Api extends Horde_Registry_Api } $events = Kronolith::getDriver(null, $calendar) - ->listEvents(new Horde_Date($startstamp), new Horde_Date($endstamp)); + ->listEvents(new Horde_Date($startstamp), + new Horde_Date($endstamp), + false, // recurrence + false, // alarm + false, // no json cache + false, // Don't cover dates + true, // Hide exceptions + false); // No tags $uids = array(); foreach ($events as $dayevents) { foreach ($dayevents as $event) { diff --git a/mnemo/lib/Api.php b/mnemo/lib/Api.php index f327a607d..2fd70ea91 100644 --- a/mnemo/lib/Api.php +++ b/mnemo/lib/Api.php @@ -92,7 +92,7 @@ class Mnemo_Api extends Horde_Registry_Api * * @return array An array of UIDs for all notes the user can access. */ - public function listNotes($notepad = null) + public function listUids($notepad = null) { global $conf; diff --git a/nag/lib/Api.php b/nag/lib/Api.php index 9b3540807..30409e75c 100644 --- a/nag/lib/Api.php +++ b/nag/lib/Api.php @@ -643,7 +643,7 @@ class Nag_Api extends Horde_Registry_Api * @return array An array of UIDs for all tasks * the user can access. */ - public function listTaskUids($tasklist = null) + public function listUids($tasklist = null) { if (!isset($GLOBALS['conf']['storage']['driver'])) { return PEAR::raiseError(_("Not configured")); diff --git a/turba/lib/Api.php b/turba/lib/Api.php index 9a54ab9b9..94321eeeb 100644 --- a/turba/lib/Api.php +++ b/turba/lib/Api.php @@ -434,7 +434,7 @@ class Turba_Api extends Horde_Registry_Api * @return array An array of UIDs for all contacts the user can access. * @throws Turba_Exception */ - public function listContacts($sources = null) + public function listUids($sources = null) { global $cfgSources, $prefs;