MDL-12309, gradebook can not sort by names while in group mode
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user