Hello,
I propose a slight improvement. Instead of using only the end date of user enrollment you can use the end date of the enrollment method or even the end date of the course. In the locallib.php file the variable $sql from line 110 may be:
SELECT ue.userid, ue.id, ue.timestart, IF (ue.timeend > 0, ue.timeend, IF (e.enrolenddate > 0, e.enrolenddate, c.enddate)) AS timeend, ue.enrolid
FROM mdl_user_enrolments ue INNER JOIN mdl_enrol e ON ue.enrolid = e.id INNER JOIN mdl_course c ON e.courseid = c.id
WHERE ue.userid = ? AND e.courseid = ?
mdl_user_enrolments.timeend takes precedence over mdl_enrol.enrolenddate. If both are zero then mdl_course.enddate is used, as the last resort.
Hello,
I propose a slight improvement. Instead of using only the end date of user enrollment you can use the end date of the enrollment method or even the end date of the course. In the locallib.php file the variable $sql from line 110 may be:
mdl_user_enrolments.timeend takes precedence over mdl_enrol.enrolenddate. If both are zero then mdl_course.enddate is used, as the last resort.