Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just a slight improvement #11

Open
salex-uriel opened this issue Nov 5, 2019 · 0 comments
Open

Just a slight improvement #11

salex-uriel opened this issue Nov 5, 2019 · 0 comments

Comments

@salex-uriel
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant