From: stronk7 Date: Fri, 29 Feb 2008 15:14:30 +0000 (+0000) Subject: Deletin the grader->get_numusers() method. I was doing some not X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=94519ff59b3b06d56b258341c24fb5e0b162a5ff;p=moodle.git Deletin the grader->get_numusers() method. I was doing some not needed checks (I guess copied from load_users(), where they have sense). Fallback to grade_report->get_numusers(), that looks ok. MDL-13403 Merged from 19_STABLE --- diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index beaa44387b..de5d91b59d 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -339,29 +339,6 @@ class grade_report_grader extends grade_report { return $this->users; } - /** - * Fetches and returns a count of all the users that will be shown on this page. - * @param bool $groups Whether to apply groupsql - * @return int Count of users - */ - function get_numusers($groups=true) { - global $CFG; - - $countsql = "SELECT COUNT(DISTINCT u.id) - FROM {$CFG->prefix}grade_grades g RIGHT OUTER JOIN - {$CFG->prefix}user u ON (u.id = g.userid AND g.itemid = $this->sortitemid) - LEFT JOIN {$CFG->prefix}role_assignments ra ON u.id = ra.userid "; - if ($groups) { - $countsql .= $this->groupsql; - } - $countsql .= " WHERE ra.roleid in ($this->gradebookroles) "; - if ($groups) { - $countsql .= $this->groupwheresql; - } - $countsql .= " AND ra.contextid ".get_related_contexts_string($this->context); - return count_records_sql($countsql); - } - /** * we supply the userids in this query, and get all the grades * pulls out all the grades, this does not need to worry about paging