From dd5c9728d746e1b0dd5983f35c3a016e09ff848a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 12 Nov 2008 09:22:45 +0000 Subject: [PATCH] "- fix inspired by Moe's patch on the German list: dont add users selected in calendar, if booking a ressource - fixed not added ressources, if booking is done in the calendar of a ressource" --- calendar/inc/class.calendar_uiforms.inc.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index d136f2e0d3..ac74c03aa2 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -83,14 +83,23 @@ class calendar_uiforms extends calendar_ui { $owner = $this->owner; } + if (!$owner || !is_numeric($owner) || $GLOBALS['egw']->accounts->get_type($owner) != 'u' || !$this->bo->check_perms(EGW_ACL_ADD,0,$owner)) { if ($owner) // make an owner who is no user or we have no add-rights a participant { - foreach(explode(',',$owner) as $uid) + // if we come from ressources we don't need any users selected in calendar + if (!isset($_GET['participants']) || $_GET['participants'][0] != 'r') { - if (is_numeric($uid)) $extra_participants[] = $uid; // dont add eg. all resources of the displayed category + foreach(explode(',',$owner) as $uid) + { + // only add users or a single ressource, not all ressources displayed by a category + if (is_numeric($uid) || $owner == $uid) + { + $extra_participants[] = $uid; + } + } } } $owner = $this->user;