} 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'));
}
* @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)) {
$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);
}
/**