course settings: MDL-18595: Fix regression caused by switching the course settings form to use the new date selector.

The bad commit was http://cvs.moodle.org/moodle/course/edit_form.php?r1=1.65&r2=1.66

Sorry everyone who was inconvenienced by this.
This commit is contained in:
tjhunt 2009-03-19 03:14:11 +00:00
parent add53f6587
commit 1d693c8fd0
2 changed files with 3 additions and 21 deletions

View File

@ -52,18 +52,9 @@
} // it'll be greyed out but we want these by default anyway.
}
$course->allowedmods = $allowedmods;
if ($course->enrolstartdate){
$course->enrolstartdisabled = 0;
}
if ($course->enrolenddate) {
$course->enrolenddisabled = 0;
}
}
}
/// first create the form
$editform = new course_edit_form('edit.php', compact('course', 'category'));
// now override defaults if course already exists
@ -84,14 +75,6 @@
/// process data if submitted
//preprocess data
if ($data->enrolstartdisabled){
$data->enrolstartdate = 0;
}
if ($data->enrolenddisabled) {
$data->enrolenddate = 0;
}
$data->timemodified = time();
if (empty($course)) {

View File

@ -464,10 +464,9 @@ class course_edit_form extends moodleform {
}
}
if (empty($data['enrolenddisabled'])){
if ($data['enrolenddate'] <= $data['enrolstartdate']){
$errors['enroldateendgrp'] = get_string('enrolenddaterror');
}
if (!empty($data['enrolstartdate']) && !empty($data['enrolenddate']) &&
$data['enrolenddate'] <= $data['enrolstartdate']){
$errors['enrolenddate'] = get_string('enrolenddaterror');
}
if (!empty($CFG->enrol_manual_usepasswordpolicy) and isset($data['enrolpassword']) and $data['enrolpassword'] != '') {