$event->setStatus(Kronolith::STATUS_FREE);
/* Fetch events. */
- $busy = Kronolith::listEvents($event->start, $event->end, $this->calendar);
- if (is_a($busy, 'PEAR_Error')) {
- return $busy;
+ $busy = Kronolith::listEvents($event->start, $event->end, array($this->calendar));
+ if ($busy instanceof 'PEAR_Error')) {
+ throw new Horde_Exception($busy->getMessage());
}
if (!count($busy)) {
if (!($e->hasStatus(Kronolith::STATUS_CANCELLED) ||
$e->hasStatus(Kronolith::STATUS_FREE))) {
+ $event-SetStatus($old_status);
return false;
}
}
$event->setStatus($old_status);
+
return true;
}
{
/* Get a driver for this resource's calendar */
$driver = Kronolith::getDriver('Resource', $this->calendar);
+
/* Make sure it's not already attached. */
$uid = $event->getUID();
$existing = $driver->getByUID($uid, array($this->calendar));
{
$driver = Kronolith::getDriver('Resource', $this->calendar);
$re = $driver->getByUID($event->getUID(), array($this->calendar));
+ if ($re instanceof PEAR_Error) {
+ throw new Horde_Exception ($re->getMessage());
+ }
+
$driver->deleteEvent($re->getId());
}