Commit 97102a56 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Check start dates are before stop dates in view access list

parent bc741342
......@@ -183,6 +183,12 @@ function editaccess_validate(Pieform $form, $values) {
if ($values['startdate'] && $values['stopdate'] && $values['startdate'] > $values['stopdate']) {
$form->set_error('startdate', get_string('startdatemustbebeforestopdate', 'view'));
}
foreach ($values['accesslist'] as $item) {
if ($item['startdate'] && $item['stopdate'] && $item['startdate'] > $item['stopdate']) {
$form->set_error('accesslist', get_string('startdatemustbebeforestopdate', 'view'));
break;
}
}
}
function editaccess_cancel_submit() {
......
Markdown is supported
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