From: Jan Schneider Date: Wed, 11 Aug 2010 15:14:17 +0000 (+0200) Subject: Revert back to let the drivers decide which kind of IDs they want. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3e898d58d1f31b4d61cfe42b99f2ed6fe6bf903d;p=horde.git Revert back to let the drivers decide which kind of IDs they want. --- diff --git a/kronolith/lib/Driver.php b/kronolith/lib/Driver.php index e65fcfca8..2e5334ceb 100644 --- a/kronolith/lib/Driver.php +++ b/kronolith/lib/Driver.php @@ -308,13 +308,6 @@ class Kronolith_Driver if ($event->stored || $event->exists()) { return $this->_updateEvent($event); } - - if (!$event->id) { - $event->id = (string)new Horde_Support_Randomid; - } - if (!$event->uid) { - $event->uid = (string)new Horde_Support_Guid; - } return $this->_addEvent($event); } diff --git a/kronolith/lib/Driver/Ical.php b/kronolith/lib/Driver/Ical.php index 30db15095..b8c0f4777 100644 --- a/kronolith/lib/Driver/Ical.php +++ b/kronolith/lib/Driver/Ical.php @@ -407,6 +407,13 @@ class Kronolith_Driver_Ical extends Kronolith_Driver */ protected function _addEvent($event) { + if (!$event->uid) { + $event->uid = (string)new Horde_Support_Uuid; + } + if (!$event->id) { + $event->id = $event->id . '.ics'; + } + $response = $this->_saveEvent($event); if (!in_array($response->code, array(200, 201, 204))) { Horde::logMessage(sprintf('Failed to create event on remote calendar: url = "%s", status = %s', diff --git a/kronolith/lib/Driver/Kolab.php b/kronolith/lib/Driver/Kolab.php index e177d8945..6d1727c19 100644 --- a/kronolith/lib/Driver/Kolab.php +++ b/kronolith/lib/Driver/Kolab.php @@ -369,6 +369,9 @@ class Kronolith_Driver_Kolab extends Kronolith_Driver ? array('action' => 'modify') : array('action' => 'add'); + if (!$event->uid) { + $event->uid = $this->_store->generateUID(); + } $this->_store->save($event->toKolab(), $edit ? $event->uid : null); /* Deal with tags */ diff --git a/kronolith/lib/Driver/Sql.php b/kronolith/lib/Driver/Sql.php index 0a81b0ad2..d39cc1d8b 100644 --- a/kronolith/lib/Driver/Sql.php +++ b/kronolith/lib/Driver/Sql.php @@ -606,6 +606,13 @@ class Kronolith_Driver_Sql extends Kronolith_Driver */ protected function _addEvent($event) { + if (!$event->id) { + $event->id = (string)new Horde_Support_Randomid; + } + if (!$event->uid) { + $event->uid = (string)new Horde_Support_Guid; + } + $query = 'INSERT INTO ' . $this->_params['table']; $cols_name = ' (event_id, event_uid,'; $cols_values = ' VALUES (?, ?,';