From ae0ba0aebc6c4786c8b12728b1e24f17c25f9b14 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 29 Dec 2006 08:47:28 +0000 Subject: [PATCH] an other fix for bug #21: Reject entry as part of group, entry still shown (should not): - socal::search() returns rejected group-invitations, as only the user not also the group is rejected - as we cant remove them efficiantly in SQL, we kick them out here, but only if just one user is displayed --- calendar/inc/class.bocal.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/calendar/inc/class.bocal.inc.php b/calendar/inc/class.bocal.inc.php index ff22473ca2..6d1e2618a6 100644 --- a/calendar/inc/class.bocal.inc.php +++ b/calendar/inc/class.bocal.inc.php @@ -343,8 +343,17 @@ class bocal $this->total = $this->so->total; $this->db2data($events,isset($params['date_format']) ? $params['date_format'] : 'ts'); + // socal::search() returns rejected group-invitations, as only the user not also the group is rejected + // as we cant remove them efficiantly in SQL, we kick them out here, but only if just one user is displayed + $remove_rejected_by_user = !$show_rejected && count($params['users']) == 1 ? $params['users'][0] : false; + //echo "

remove_rejected_by_user=$remove_rejected_by_user, show_rejected=$show_rejected, params[users]=".print_r($param['users'])."

\n"; foreach($events as $id => $event) { + if ($remove_rejected_by_user && $event['participants'][$remove_rejected_by_user] == 'R') + { + unset($events[$id]); // remove the rejected event + continue; + } if ($params['enum_groups'] && $this->enum_groups($event)) { $events[$id] = $event;