mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
Make the sorting of the names always by lastname, to match assign roles
This commit is contained in:
parent
abf980a587
commit
cbf643f5f0
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user