Browse Source

Fixing default user list order see #7441

Julio 10 years ago
parent
commit
699f26c5ff
1 changed files with 7 additions and 0 deletions
  1. 7 0
      main/inc/lib/course.lib.php

+ 7 - 0
main/inc/lib/course.lib.php

@@ -1379,6 +1379,13 @@ class CourseManager
         $session_id = intval($session_id);
         $course_code = Database::escape_string($course_code);
         $where = array();
+        
+        if (empty($order_by)) {
+            $order_by = 'user.lastname, user.firstname';
+            if (api_is_western_name_order()) {
+                $order_by = 'user.firstname, user.lastname';
+            }
+        }
 
         // if the $order_by does not contain 'ORDER BY' we have to check if it is a valid field that can be sorted on
         if (!strstr($order_by,'ORDER BY')) {