/**
*/
public function davDeleteObject($collection, $object)
{
$dav = $GLOBALS['injector']->getInstance('Horde_Dav_Storage');
$internal = $dav->getInternalCollectionId($collection, 'calendar') ?: $collection;
if (!Kronolith::hasPermission($internal, Horde_Perms::DELETE)) {
throw new Kronolith_Exception(_("Calendar does not exist or no permission to delete"));
}
try {
$object = $dav->getInternalObjectId($object, $internal) ?: preg_replace('/\\.ics$/', '', $object);
} catch (Horde_Dav_Exception $e) {
}
$kronolith_driver = Kronolith::getDriver(null, $internal);
$event = $kronolith_driver->getEvent($object);
$kronolith_driver->deleteEvent($object);
try {
$dav->deleteExternalObjectId($object, $internal);
} catch (Horde_Dav_Exception $e) {
}
// Send iTip messages unless organizer is external.
// Notifications will get lost, there is no way to return messages to
// clients.
if ($event->organizer && !Kronolith::isUserEmail($event->creator, $event->organizer)) {
return;
}
Kronolith::sendITipNotifications($event, new Horde_Notification_Handler(new Horde_Notification_Storage_Object()), Kronolith::ITIP_CANCEL);
}