From: moodler Date: Sun, 1 Oct 2006 08:48:58 +0000 (+0000) Subject: Make the sorting of the names always by lastname, to match assign roles X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cbf643f5f0ba7fc0a61885fc58eccb80e707eba4;p=moodle.git Make the sorting of the names always by lastname, to match assign roles --- diff --git a/course/groups.php b/course/groups.php index 36ddd19043..208ee29c26 100644 --- a/course/groups.php +++ b/course/groups.php @@ -184,7 +184,7 @@ foreach ($groups as $group) { $countusers = 0; $listmembers[$group->id] = array(); - if ($groupusers = get_group_users($group->id)) { + if ($groupusers = get_group_users($group->id, 'u.lastname ASC, u.firstname ASC')) { foreach ($groupusers as $key=>$groupuser) { if (!array_key_exists($groupuser->id, $nonmembers)) { // group member with another role @@ -197,15 +197,12 @@ $countusers++; } } - natcasesort($listmembers[$group->id]); } $listgroups[$group->id] = $group->name." ($countusers)"; } natcasesort($listgroups); } - natcasesort($nonmembers); - if (empty($selectedgroup)) { // Choose the first group by default if ($selectedgroup = array_shift($temparr = array_keys($listgroups))) { $members = $listmembers[$selectedgroup];