Browse Source

Fix #354

MOODLE_36_STABLE
Dan Marsden 6 years ago
parent
commit
7c63aa3245
  1. 8
      add_form.php

8
add_form.php

@ -336,11 +336,11 @@ class mod_attendance_add_form extends moodleform {
if ($addmulti && ceil(($data['sessionenddate'] - $data['sessiondate']) / YEARSECS) > 1) { if ($addmulti && ceil(($data['sessionenddate'] - $data['sessiondate']) / YEARSECS) > 1) {
$errors['sessionenddate'] = get_string('timeahead', 'attendance'); $errors['sessionenddate'] = get_string('timeahead', 'attendance');
} }
$sessstart = $data['sessiondate'] + $sesstarttime;
if ($data['sessiondate'] < $data['coursestartdate'] && $data['sessiondate'] != $data['previoussessiondate']) { if ($sessstart < $data['coursestartdate'] && $sessstart != $data['previoussessiondate']) {
$errors['sessiondate'] = get_string('priorto', 'attendance', $errors['sessiondate'] = get_string('priorto', 'attendance',
userdate($data['coursestartdate'], get_string('strftimedmy', 'attendance'))); userdate($data['coursestartdate'], get_string('strftimedmyhm', 'attendance')));
$this->_form->setConstant('previoussessiondate', $data['sessiondate']); $this->_form->setConstant('previoussessiondate', $sessstart);
} }
if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) {

Loading…
Cancel
Save