From 0a3e970319be476f1c7aefb50d425b43881b2987 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 25 Sep 2006 06:09:06 +0000 Subject: [PATCH] FIxed some problems when getting teacher lists for print_course --- course/lib.php | 2 +- lib/accesslib.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/course/lib.php b/course/lib.php index 26ff55f7ab..6158e76ede 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1535,7 +1535,7 @@ function print_course($course, $width="100%") { if ($teachers = get_users_by_capability($context, 'moodle/course:update', 'u.*, ul.timeaccess as lastaccess, ra.hidden', - $sort, '','','',$exceptions, false)) { + 'r.sortorder ASC', '','','','', false)) { $canseehidden = has_capability('moodle/role:viewhiddenassigns', $context); $namesarray = array(); foreach ($teachers as $teacher) { diff --git a/lib/accesslib.php b/lib/accesslib.php index b766e6641d..652c53e704 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2654,6 +2654,7 @@ function get_users_by_capability($context, $capability, $fields='', $sort='', $select = " SELECT $fields"; $from = " FROM {$CFG->prefix}user u INNER JOIN {$CFG->prefix}role_assignments ra ON ra.userid = u.id + INNER JOIN {$CFG->prefix}role r ON r.id = ra.roleid LEFT OUTER JOIN {$CFG->prefix}user_lastaccess ul ON ul.userid = u.id $groupjoin"; $where = " WHERE ra.contextid ".get_related_contexts_string($context)." -- 2.39.5