$resources = $event->getResources();
if (count($resources)) {
$rd = Kronolith::getDriver('Resource');
- foreach (array_keys($resources) as $uid) {
- $r = $rd->getResource($uid);
- $r->removeEvent($event);
+ foreach ($resources as $uid => $resource) {
+ if ($resource['response'] !== Kronolith::RESPONSE_DECLINED) {
+ $r = $rd->getResource($uid);
+ $r->removeEvent($event);
+ }
}
}
if (!($e->start->compareDateTime($event->end) >= 1 ||
$e->end->compareDateTime($event->start) <= -1)) {
- // $e starts after $event ends OR $e ends before $event->start
-
return false;
}
}
{
$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());
+ // Event will only be in the calendar if it's been accepted. This error
+ // should never happen, but put it here as a safeguard for now.
+ if (!($re instanceof PEAR_Error)) {
+ $driver->deleteEvent($re->getId());
}
-
- $driver->deleteEvent($re->getId());
}
/**
throw new Horde_Exception(_("Resource already exists. Cannot change the id."));
}
}
+
}
\ No newline at end of file