From c18ad4afd688ea488050b4b585312e48ac8f4e47 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Tue, 8 Mar 2016 12:01:32 +0800 Subject: [PATCH] MDL-49861 mod_data: Save and add another button clears fields. --- mod/data/edit.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/data/edit.php b/mod/data/edit.php index df09006d958..132f600438c 100644 --- a/mod/data/edit.php +++ b/mod/data/edit.php @@ -268,6 +268,9 @@ if ($datarecord = data_submitted() and confirm_sesskey()) { 'rid' => $recordid, )); redirect($viewurl); + } else if (!empty($datarecord->saveandadd)) { + // User has clicked "Save and add another". Reset all of the fields. + $datarecord = null; } } } @@ -354,7 +357,7 @@ if ($rid) { echo ' '; } else { if ((!$data->maxentries) || has_capability('mod/data:manageentries', $context) || (data_numentries($data) < ($data->maxentries - 1))) { - echo ' '; + echo ' '; } } echo ''; -- 2.43.0