mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Better handling of country sorting
This commit is contained in:
parent
66c95f3224
commit
8538258121
1 changed files with 12 additions and 1 deletions
|
@ -145,6 +145,17 @@
|
||||||
if ($users = get_records_sql("SELECT * from user WHERE username <> 'guest'
|
if ($users = get_records_sql("SELECT * from user WHERE username <> 'guest'
|
||||||
AND deleted <> '1' ORDER BY $sort $dir")) {
|
AND deleted <> '1' ORDER BY $sort $dir")) {
|
||||||
|
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$user->country = $COUNTRIES[$user->country];
|
||||||
|
}
|
||||||
|
if ($sort == "country") { // Need to resort by full country name, not code
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$susers[$user->country] = $user;
|
||||||
|
}
|
||||||
|
$users = $susers;
|
||||||
|
asort($users);
|
||||||
|
}
|
||||||
|
|
||||||
print_heading(get_string("chooseuser"));
|
print_heading(get_string("chooseuser"));
|
||||||
|
|
||||||
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
|
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
|
||||||
|
@ -164,7 +175,7 @@
|
||||||
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
|
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
|
||||||
"$user->email",
|
"$user->email",
|
||||||
"$user->city",
|
"$user->city",
|
||||||
$COUNTRIES[$user->country],
|
"$user->country",
|
||||||
$strlastaccess,
|
$strlastaccess,
|
||||||
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
|
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
|
||||||
$deletebutton);
|
$deletebutton);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue