-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
3.7.1, 3.8
-
MOODLE_37_STABLE, MOODLE_38_STABLE
The enrol/database plugin currently gets course startdate and enddate from the template only, but should allow setting these from the remote DB fields.
A complete fix for this would include:
- Add UI to specify the remote startdate and enddate field names
- Validate incoming startdate and enddate; validate startdate <= enddate
- If startdate is not set, default it to time()
- If enddate is not set or invalid, default enddate = 0
- If enddate is set and valid, default startdate=enddate
- If set and valid, set the course startdate and enddate on course creation
- For weekly course formats, set the course->numsections to the number of weeks in between startdate and enddate.
- Override the template values: startdate, enddate, numsections