MDL-12345 - use consistent ordering on both sides of the assign group members

pane, sorted by lastname like other screens
merged from MOODLE_19_STABLE
This commit is contained in:
poltawski
2007-12-27 13:40:27 +00:00
parent 990027e130
commit 47d1ec41ce
2 changed files with 4 additions and 4 deletions
+4 -3
View File
@@ -308,7 +308,7 @@ function groups_delete_groupings($courseid, $showfeedback=false) {
* This function was changed to get_users_by_capability style
* mostly because of the searchtext requirement
*/
function groups_get_users_not_in_group($courseid, $groupid, $searchtext='') {
function groups_get_users_not_in_group($courseid, $groupid, $searchtext='', $sort = 'u.lastname ASC') {
global $CFG;
@@ -369,8 +369,9 @@ function groups_get_users_not_in_group($courseid, $groupid, $searchtext='') {
WHERE groupid = $groupid)
$wheresearch";
$groupby = " GROUP BY u.id, u.firstname, u.lastname ";
$orderby = " ORDER BY $sort";
return get_records_sql($select.$from.$where.$groupby);
return get_records_sql($select.$from.$where.$groupby.$orderby);
}
@@ -490,4 +491,4 @@ function groups_unassign_grouping($groupingid, $groupid) {
return delete_records('groupings_groups', 'groupingid', $groupingid, 'groupid', $groupid);
}
?>
?>
-1
View File
@@ -116,7 +116,6 @@ if ($potentialmemberscount <= MAX_USERS_PER_PAGE) {
foreach ($potentialmembers as $userid => $user) {
$nonmembers[$userid] = fullname($user)." (".@count($usergroups[$userid]).")";
}
natcasesort($nonmembers);
// Print out the HTML
foreach($nonmembers as $id => $name) {