Skip to content

Just a slight improvement #11

@salex-uriel

Description

@salex-uriel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions