}
/**
- * Stub to be overridden in the child class.
+ * Moves an event to a new calendar.
+ *
+ * @param string $eventId The event to move.
+ * @param string $newCalendar The new calendar.
*/
public function move($eventId, $newCalendar)
{
+ $event = $this->_move($eventId, $newCalendar);
+
+ /* Log the moving of this item in the history log. */
+ $uid = $event->uid;
+ if ($uid) {
+ $history = Horde_History::singleton();
+ $history->log('kronolith:' . $event->calendar . ':' . $uid, array('action' => 'delete'), true);
+ $history->log('kronolith:' . $newCalendar . ':' . $uid, array('action' => 'add'), true);
+ }
+ }
+
+ /**
+ * Stub to be overridden in the child class.
+ */
+ protected function _move($eventId, $newCalendar)
+ {
return PEAR::raiseError('Not supported');
}
}
/**
- * Move an event to a new calendar.
+ * Moves an event to a new calendar.
*
* @param string $eventId The event to move.
* @param string $newCalendar The new calendar.
+ *
+ * @return Kronolith_Event The old event.
*/
- public function move($eventId, $newCalendar)
+ protected function _move($eventId, $newCalendar)
{
$event = $this->getEvent($eventId);
Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($newCalendar));
}
- /* Log the moving of this item in the history log. */
- $uid = $event->uid;
- $history = Horde_History::singleton();
- $history->log('kronolith:' . $event->calendar . ':' . $uid, array('action' => 'delete'), true);
- $history->log('kronolith:' . $newCalendar . ':' . $uid, array('action' => 'add'), true);
-
- return $result;
+ return $event;
}
/**
}
/**
- * Move an event to a new calendar.
+ * Moves an event to a new calendar.
*
* @param string $eventId The event to move.
* @param string $newCalendar The new calendar.
+ *
+ * @return Kronolith_Event The old event.
*/
- public function move($eventId, $newCalendar)
+ protected function _move($eventId, $newCalendar)
{
/* Fetch the event for later use. */
$event = $this->getEvent($eventId);
return $result;
}
- /* Log the moving of this item in the history log. */
- $uid = $event->uid;
- if ($uid) {
- $history = Horde_History::singleton();
- $history->log('kronolith:' . $this->calendar . ':' . $uid, array('action' => 'delete'), true);
- $history->log('kronolith:' . $newCalendar . ':' . $uid, array('action' => 'add'), true);
- }
-
- return true;
+ return $event;
}
/**