diff --git a/add_form.php b/add_form.php index dabaeb1..51bffba 100644 --- a/add_form.php +++ b/add_form.php @@ -161,6 +161,12 @@ class mod_attendance_add_form extends moodleform { if ($data['sessiontype'] == attendance::SESSION_GROUP and empty($data['groups'])) { $errors['groups'] = get_string('errorgroupsnotselected', 'attendance'); } + + $addmulti = isset($data['addmultiply'])? (int)$data['addmultiply'] : 0; + if (($addmulti != 0) && (!array_key_exists('sdays',$data) || empty($data['sdays']))) { + $data['sdays']= array(); + $errors['sdays'] = get_string('required', 'attendance'); + } return $errors; } diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 9d4387a..f79b88a 100755 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -153,6 +153,7 @@ $string['pluginname'] = 'Attendance'; $string['pluginadministration'] = 'Attendance administration'; $string['remarks'] = 'Remarks'; $string['report'] = 'Report'; +$string['required'] = 'Required*'; $string['resetdescription'] = 'Remember that deleting attendance data will erase information from database. You can just hide older sessions having changed start date of course!'; $string['resetstatuses'] = 'Reset statuses to default'; $string['restoredefaults'] = 'Restore defaults';