$notification->push(sprintf(_("There was an error adding the event: %s"), $message), 'horde.error');
} else {
+ Kronolith::notifyOfResoruceRejection($event);
if (Horde_Util::getFormData('sendupdates', false)) {
$event = Kronolith::getDriver()->getEvent($result);
if (is_a($event, 'PEAR_Error')) {
} elseif (Horde_Util::getFormData('sendupdates', false)) {
Kronolith::sendITipNotifications($event, $GLOBALS['notification'], Kronolith::ITIP_REQUEST);
}
+ Kronolith::notifyOfResoruceRejection($event);
}
function _check_max()
if (($edit_recur = Horde_Util::getFormData('edit_recur')) &&
$edit_recur != 'all' && $edit_recur != 'copy' &&
_check_max()) {
+
/* Get event details. */
$kronolith_driver->open($source);
$event = &$kronolith_driver->getEvent(Horde_Util::getFormData('eventID'));
}
/**
+ * Check for resource declines and push notice to stack if found.
+ *
+ * @param Kronolith_Event #
+ */
+ public static function notifyOfResoruceRejection($event)
+ {
+ $declined = array();
+ foreach ($event->getResources() as $id => $resource) {
+ if ($resource['response'] == Kronolith::RESPONSE_DECLINED) {
+ $r = Kronolith::getDriver('Resource')->getResource($id);
+ $declined[] = $r->name;
+ }
+ }
+ if (count($declined)) {
+ $GLOBALS['notification']->push(sprintf(ngettext("The following resource has declined your request: %s",
+ "The following resources have declined your request: %s",
+ count($declined)),
+ implode(", ", $declined)),
+ 'horde.error');
+ }
+ }
+
+ /**
* Returns whether a user wants email notifications for a calendar.
*
* @access private