MDL-12309, gradebook can not sort by names while in group mode

This commit is contained in:
toyomoyo
2007-11-22 05:17:26 +00:00
parent 38c77dc617
commit d2b8b98732
2 changed files with 5 additions and 7 deletions
+2 -5
View 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'));
}
+3 -2
View File
@@ -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);
}
/**