Permalink
Browse files

MDL-43408 gradereport_grader: Display users with expired enrolments a…

…s inactive in grader report

Conflicts:
	grade/report/grader/lib.php
  • Loading branch information...
tonyjbutler authored and danpoltawski committed Dec 16, 2013
1 parent ba5255f commit df9f225353b2d922b6f5663bb3979658703c7791
Showing with 4 additions and 1 deletion.
  1. +4 −1 grade/report/grader/lib.php
@@ -471,9 +471,12 @@ public function load_users() {
AND ue.status = :uestatus
AND e.status = :estatus
AND e.courseid = :courseid
+ AND ue.timestart < :now1 AND (ue.timeend = 0 OR ue.timeend > :now2)
GROUP BY ue.userid";
$coursecontext = get_course_context($this->context);
- $params = array_merge($uparams, array('estatus'=>ENROL_INSTANCE_ENABLED, 'uestatus'=>ENROL_USER_ACTIVE, 'courseid'=>$coursecontext->instanceid));
+ $time = time();
+ $params = array_merge($uparams, array('estatus' => ENROL_INSTANCE_ENABLED, 'uestatus' => ENROL_USER_ACTIVE,
+ 'courseid' => $coursecontext->instanceid, 'now1' => $time, 'now2' => $time));
$useractiveenrolments = $DB->get_records_sql($sql, $params);
$defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);

0 comments on commit df9f225

Please sign in to comment.