MDL-49701 mod_lesson: open time should be before close time

Conflicts:
	mod/lesson/mod_form.php
This commit is contained in:
Jean-Michel Vedrine
2015-08-02 10:41:01 +02:00
parent 9f405b6c6d
commit e3bc5a8e27
+7
View File
@@ -337,6 +337,13 @@ class mod_lesson_mod_form extends moodleform_mod {
if (empty($data['maxtime']) and !empty($data['timed'])) {
$errors['timedgrp'] = get_string('err_numeric', 'form');
}
// Check open and close times are consistent.
if ($data['available'] != 0 && $data['deadline'] != 0 &&
$data['deadline'] < $data['available']) {
$errors['deadline'] = get_string('closebeforeopen', 'lesson');
}
if (!empty($data['usepassword']) && empty($data['password'])) {
$errors['password'] = get_string('emptypassword', 'lesson');
}