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);
}
*/
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',
? 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 */
*/
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 (?, ?,';