mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-37390 course: Set startdate and enddate properly for approved course
Once a course is approved the startdate and enddate were not set properly This patch sets current date as startdate and enddate is startdate + default duration of the course
This commit is contained in:
parent
f5b956679e
commit
6363c9ade2
@ -3017,6 +3017,10 @@ class course_request {
|
||||
$data->lang = $courseconfig->lang;
|
||||
$data->enablecompletion = $courseconfig->enablecompletion;
|
||||
$data->numsections = $courseconfig->numsections;
|
||||
$data->startdate = usergetmidnight(time());
|
||||
if ($courseconfig->courseenddateenabled) {
|
||||
$data->enddate = usergetmidnight(time()) + $courseconfig->courseduration;
|
||||
}
|
||||
|
||||
$course = create_course($data);
|
||||
$context = context_course::instance($course->id, MUST_EXIST);
|
||||
|
Loading…
x
Reference in New Issue
Block a user