should fix the participants problem

This commit is contained in:
skeeter 2001-03-16 01:54:22 +00:00
parent e4d1e6ec0c
commit 3b01bdf279

View File

@ -239,20 +239,19 @@
$users = Array(); $users = Array();
for($i=0;$i<count($accounts);$i++) for($i=0;$i<count($accounts);$i++)
{ {
$user = $accounts[$i]; if($accounts[$i] != $owner && !isset($users[$accounts[$i]]))
if($user != $owner && !isset($users[$user]))
{ {
$users[$user] = $phpgw->common->grab_owner_name($user); $users[$user] = $phpgw->common->grab_owner_name($accounts[$i]);
if($phpgw->accounts->get_type($user) == 'g') if($phpgw->accounts->get_type($accounts[$i]) == 'g')
{ {
$group_members = $phpgw->acl->get_ids_for_location($user,1,'phpgw_group'); $group_members = $phpgw->acl->get_ids_for_location($accounts[$i],1,'phpgw_group');
if($group_members != False) if($group_members != False)
{ {
for($j=0;$j<count($group_members);$j++) for($j=0;$j<count($group_members);$j++)
{ {
if($group_members[$j] != $owner && !isset($users[$group_members[$j]])) if(intval($group_members[$j]) != $owner && !isset($users[intval($group_members[$j])]))
{ {
$users[$group_members[$j]] = $phpgw->common->grab_owner_name($group_members[$j]); $users[intval($group_members[$j])] = $phpgw->common->grab_owner_name(intval($group_members[$j]));
} }
} }
} }
@ -260,18 +259,6 @@
} }
} }
// if ($num_users > 50)
// {
// $size = 15;
// }
// elseif ($num_users > 5)
// {
// $size = 5;
// }
// else
// {
// $size = $num_users;
// }
$str = "\n".' <select name="participants[]" multiple size="5">'."\n"; $str = "\n".' <select name="participants[]" multiple size="5">'."\n";
for ($l=0;$l<count($event->participants);$l++) for ($l=0;$l<count($event->participants);$l++)
{ {
@ -280,11 +267,13 @@
@asort($users); @asort($users);
@reset($users); @reset($users);
$user = Array();
while ($user = each($users)) while ($user = each($users))
{ {
if($user[0] != $owner && $phpgw->accounts->exists(intval($user[0])) == True) $userid = intval($user[0]);
if($userid != $owner && $phpgw->accounts->exists($userid) == True)
{ {
$str .= ' <option value="' . $user[0] . '"'.$parts[$user[0]].'>('.$phpgw->accounts->get_type($user[0]).') '.$user[1].'</option>'."\n"; $str .= ' <option value="' . $userid . '"'.$parts[$userid].'>('.$phpgw->accounts->get_type($userid).') '.$user[1].'</option>'."\n";
} }
} }
$str .= ' </select>'; $str .= ' </select>';