Fix Cancel button on Edit form.

This commit is contained in:
Mikhail Golenkov committed 2020-02-04 17:41:08 +11:00
1 parent 0137811f2b
commit 587bd3a311
2 files changed
+17 -7

No files matched your search

+9 -5
View File
@@ -38,11 +38,15 @@ $PAGE->set_url(new moodle_url('/auth/outage/manage.php'));
$mform = new edit();
if ($mform->is_cancelled()) {
redirect(new moodle_url('/auth/outage/manage.php'));
} else if ($outage = $mform->get_data()) {
$id = outagedb::save($outage);
redirect(new moodle_url('/auth/outage/manage.php'));
if ($mform->is_submitted()) {
$mform->is_validated();
if ($mform->is_cancelled()) {
redirect(new moodle_url('/auth/outage/manage.php'));
} else if ($outage = $mform->get_data()) {
$id = outagedb::save($outage);
redirect(new moodle_url('/auth/outage/manage.php'));
}
}
$clone = optional_param('clone', 0, PARAM_INT);