Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better handling of country sorting

  • Loading branch information...
commit 8538258121d338ea40a064f60a051e8cbd62ec5a 1 parent 66c95f3
martin authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 admin/user.php
View
13 admin/user.php
@@ -145,6 +145,17 @@
if ($users = get_records_sql("SELECT * from user WHERE username <> 'guest'
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"));
$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>",
"$user->email",
"$user->city",
- $COUNTRIES[$user->country],
+ "$user->country",
$strlastaccess,
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
$deletebutton);
Please sign in to comment.
Something went wrong with that request. Please try again.