From a185f5b6749128cd5bc6baef291cb40cd79f368c Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 12 Sep 2009 12:22:04 -0400 Subject: [PATCH] Notify for acceptance as well --- kronolith/lib/Kronolith.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); -- 2.11.0