From: Michael J. Rubinsky Date: Wed, 9 Sep 2009 18:48:21 +0000 (-0400) Subject: Add resources to list of attendees returned from this method X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1917b4e44444d469e6876b31af3622c5a230a201;p=horde.git Add resources to list of attendees returned from this method --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index eb35057f9..d8efff968 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1241,20 +1241,32 @@ class Kronolith } /** - * Returns a comma separated list of attendees. + * Returns a comma separated list of attendees and resources * - * @return string Attendee list. + * @return string Attendee/Resource list. */ public static function attendeeList() { - if (!isset($_SESSION['kronolith']['attendees']) || - !is_array($_SESSION['kronolith']['attendees'])) { - return ''; + $attendees = array(); + + /* Attendees */ + if (isset($_SESSION['kronolith']['attendees']) || + is_array($_SESSION['kronolith']['attendees'])) { + + $attendees = array(); + foreach ($_SESSION['kronolith']['attendees'] as $email => $attendee) { + $attendees[] = empty($attendee['name']) ? $email : Horde_Mime_Address::trimAddress($attendee['name'] . (strpos($email, '@') === false ? '' : ' <' . $email . '>')); + } + } - $attendees = array(); - foreach ($_SESSION['kronolith']['attendees'] as $email => $attendee) { - $attendees[] = empty($attendee['name']) ? $email : Horde_Mime_Address::trimAddress($attendee['name'] . (strpos($email, '@') === false ? '' : ' <' . $email . '>')); + /* Resources */ + if (isset($_SESSION['kronolith']['resources']) || + is_array($_SESSION['kronolith']['resources'])) { + + foreach ($_SESSION['kronolith']['resources'] as $resource) { + $attendees[] = $resource['name']; + } } return implode(', ', $attendees);