Commit 40eea06c authored by David Monllaó's avatar David Monllaó
Browse files

MDL-22078 course reset: No enddate time shift if no enddate

parent 21d89211
......@@ -188,8 +188,8 @@ class course_reset_form extends moodleform {
if ($data['reset_end_date'] != 0) {
// End date set by the user has preference.
$coursedata['enddate'] = $data['reset_end_date'];
} else if ($data['reset_start_date'] > 0) {
// Otherwise reset_course_userdata will add the start date time shift.
} else if ($data['reset_start_date'] > 0 && $course->enddate != 0) {
// Otherwise, if the current course enddate is set, reset_course_userdata will add the start date time shift to it.
$timeshift = $data['reset_start_date'] - usergetmidnight($course->startdate);
$coursedata['enddate'] = $course->enddate + $timeshift;
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment