Skip to content

Commit

Permalink
MDL-61081 enrol: Start and end date for courses created by external db
Browse files Browse the repository at this point in the history
Course created by external db enrolment plugin should have start date as current date
and end date is todays date + default course duration
  • Loading branch information
farhan6318 authored and sarjona committed Jan 12, 2018
1 parent f5b9566 commit 19f0685
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions enrol/database/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,10 @@ public function sync_courses(progress_trace $trace) {
$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) {
Expand Down

0 comments on commit 19f0685

Please sign in to comment.