Basic form validation for create/edit outage. Checks if starttime is in past, stoptime is after starttime, warningduration is not zero and title size. Issue #7.

This commit is contained in:
Daniel Thee Roperto
2016-09-05 15:01:22 +10:00
parent 6055f52d64
commit 98de8a6c69
6 changed files with 51 additions and 24 deletions

View File

@@ -39,8 +39,8 @@ class auth_outage_renderer extends plugin_renderer_base
}
public function renderdeleteconfirmation(outage $outage) {
return $this->rendersubtitle('removeoutage')
. html_writer::tag('p', get_string('removeoutagewarning', 'auth_outage'))
return $this->rendersubtitle('outageremove')
. html_writer::tag('p', get_string('outageremovewarning', 'auth_outage'))
. $this->renderoutage($outage, false);
}
@@ -61,7 +61,7 @@ class auth_outage_renderer extends plugin_renderer_base
$html .= html_writer::empty_tag('br')
. html_writer::link(
$url,
$img . ' ' . get_string('createoutage', 'auth_outage'),
$img . ' ' . get_string('outagecreate', 'auth_outage'),
['title' => get_string('remove')])
. html_writer::empty_tag('br');