From: Michael J. Rubinsky Date: Sat, 12 Sep 2009 16:22:04 +0000 (-0400) Subject: Notify for acceptance as well X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a185f5b6749128cd5bc6baef291cb40cd79f368c;p=horde.git Notify for acceptance as well --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 3d87b89ea..d43b8c253 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1545,11 +1545,17 @@ class Kronolith public static function notifyOfResoruceRejection($event) { $declined = array(); + $accepted = array(); foreach ($event->getResources() as $id => $resource) { if ($resource['response'] == Kronolith::RESPONSE_DECLINED) { $r = Kronolith::getDriver('Resource')->getResource($id); $declined[] = $r->get('name'); + } elseif ($resource['response'] == Kronolith::RESPONSE_ACCEPTED) { + $r = Kronolith::getDriver('Resource')->getResource($id); + $accepted[] = $r->get('name'); } + + } if (count($declined)) { $GLOBALS['notification']->push(sprintf(ngettext("The following resource has declined your request: %s", @@ -1558,6 +1564,13 @@ class Kronolith implode(", ", $declined)), 'horde.error'); } + if (count($accepted)) { + $GLOBALS['notification']->push(sprintf(ngettext("The following resource has accepted your request: %s", + "The following resources have accepted your request: %s", + count($accepted)), + implode(", ", $accepted)), + 'horde.success'); + } } /** @@ -2043,7 +2056,7 @@ class Kronolith */ static public function getInternalCalendar($target) { - if (self::isResourceCalendar($target)) { + if (Kronolith_Resource::isResourceCalendar($target)) { $driver = self::getDriver('Resource'); $id = $driver->getResourceIdByCalendar($target); return $driver->getResource($id);