From 19f06850694801fe67973030be3d356eff2c6c09 Mon Sep 17 00:00:00 2001 From: Farhan Karmali Date: Fri, 29 Dec 2017 20:43:34 +0530 Subject: [PATCH] MDL-61081 enrol: Start and end date for courses created by external db Course created by external db enrolment plugin should have start date as current date and end date is todays date + default course duration --- enrol/database/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/enrol/database/lib.php b/enrol/database/lib.php index 1ecb250749d..c8881691134 100644 --- a/enrol/database/lib.php +++ b/enrol/database/lib.php @@ -783,6 +783,10 @@ class enrol_database_plugin extends enrol_plugin { $template->visible = $courseconfig->visible; $template->lang = $courseconfig->lang; $template->groupmodeforce = $courseconfig->groupmodeforce; + $template->startdate = usergetmidnight(time()); + if ($courseconfig->courseenddateenabled) { + $template->enddate = usergetmidnight(time()) + $courseconfig->courseduration; + } } foreach ($createcourses as $fields) {