]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12309, gradebook can not sort by names while in group mode
authortoyomoyo <toyomoyo>
Thu, 22 Nov 2007 05:17:26 +0000 (05:17 +0000)
committertoyomoyo <toyomoyo>
Thu, 22 Nov 2007 05:17:26 +0000 (05:17 +0000)
grade/report/grader/lib.php
lib/accesslib.php

index 924ed9ec67be1f83a291d38f16f560697cee968b..ccb1b3f7972a322f58529b938a49a73571ade45c 100644 (file)
@@ -291,12 +291,9 @@ class grade_report_grader extends grade_report {
             } elseif ($this->sortitemid == 'firstname') {
                 $sort2 = ', u.lastname ' . $this->sortorder;
             }
-
             $this->users = get_role_users($this->gradebookroles, $this->context, false,
-                                'u.id, u.firstname, u.lastname', 'u.'.$this->sortitemid .' '. $this->sortorder . $sort2,
-                                false, $this->page * $this->get_pref('studentsperpage'), $this->get_pref('studentsperpage'),
-                                $this->currentgroup);
-            // need to cut users down by groups
+                            'u.id, u.firstname, u.lastname', 'u.'.$this->sortitemid .' '. $this->sortorder . $sort2,
+                            false, $this->currentgroup, $this->page * $this->get_pref('studentsperpage'), $this->get_pref('studentsperpage'));
 
         }
 
index 05b59ac3776acc7696f740cdc82f5990b8faa173..14bc6b4ff407693dd3b471dd3d969fd6bd36186a 100755 (executable)
@@ -4348,7 +4348,7 @@ function get_users_by_capability($context, $capability, $fields='', $sort='',
  * @param bool gethidden - whether to fetch hidden enrolments too
  * @return array()
  */
-function get_role_users($roleid, $context, $parent=false, $fields='', $sort='u.lastname ASC', $gethidden=true, $group='') {
+function get_role_users($roleid, $context, $parent=false, $fields='', $sort='u.lastname ASC', $gethidden=true, $group='', $limitfrom='', $limitnum='') {
     global $CFG;
 
     if (empty($fields)) {
@@ -4400,7 +4400,8 @@ function get_role_users($roleid, $context, $parent=false, $fields='', $sort='u.l
             $hiddensql
             ORDER BY $sort
             ";                  // join now so that we can just use fullname() later
-    return get_records_sql($SQL);
+
+    return get_records_sql($SQL, $limitfrom, $limitnum);
 }
 
 /**