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
This commit is contained in:
Ralf Becker 2006-12-29 08:47:28 +00:00
parent b2d586add6
commit ae0ba0aebc

View File

@ -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 "<p align=right>remove_rejected_by_user=$remove_rejected_by_user, show_rejected=$show_rejected, params[users]=".print_r($param['users'])."</p>\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;