From ef7805aa3657e47daaa266b5334e98a1c1667d5f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 11 Jan 2018 18:19:33 +0000 Subject: [PATCH] Bug 19957: Allow continued editing of report after saving To test: 1 - Edit or create a report 2 - Save it 3 - Note the report is saved but you can't keep editing 4 - Clicking 'Edit' returns you to editing 5 - Apply patch 6 - Save report 7 - Note success message remains, but report is still open for editing 8 - Note when you click the saved/updated message dissappears 9 - Try again after inserting erros into report (No Select, bad authorised value, etc.) 10 - Note errors stil display as expected 11 - Verify message works on update of existing report and save of new new report Signed-off-by: Owen Leonard Signed-off-by: Charles Farmer Signed-off-by: Katrin Fischer Joubu: amended patch to fix alignment Signed-off-by: Jonathan Druart --- .../modules/reports/guided_reports_start.tt | 30 +++++++++---------- reports/guided_reports.pl | 26 ++++++++++++---- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 706e1d683c..ba47ba4c1f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -812,6 +812,17 @@ Sub report: @@ -854,21 +865,6 @@ Sub report: $('#limitselect').submit(); }); + $(document).click(function() { + $('#report_updated').hide(); + }); + $(".goback").on("click",function(e){ e.preventDefault(); window.history.back(); diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 67d28c97cc..8809b81710 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -144,12 +144,12 @@ elsif ( $phase eq 'Build new' ) { } } $template->param( - 'saved1' => 1, - 'savedreports' => $reports, - 'usecache' => $usecache, - 'groups_with_subgroups'=> groups_with_subgroups($group, $subgroup), - filters => $filter, - has_obsolete_reports => $has_obsolete_reports, + 'saved1' => 1, + 'savedreports' => $reports, + 'usecache' => $usecache, + 'groups_with_subgroups' => groups_with_subgroups( $group, $subgroup ), + filters => $filter, + has_obsolete_reports => $has_obsolete_reports, ); } @@ -279,6 +279,13 @@ elsif ( $phase eq 'Update SQL'){ 'save_successful' => 1, 'reportname' => $reportname, 'id' => $id, + 'editsql' => 1, + 'sql' => $sql, + 'groups_with_subgroups' => groups_with_subgroups($group, $subgroup), + 'notes' => $notes, + 'cache_expiry' => $cache_expiry, + 'public' => $public, + 'usecache' => $usecache, ); logaction( "REPORTS", "MODIFY", $id, "$reportname | $sql" ) if C4::Context->preference("ReportsLog"); } @@ -648,6 +655,13 @@ elsif ( $phase eq 'Save Report' ) { 'save_successful' => 1, 'reportname' => $name, 'id' => $id, + 'editsql' => 1, + 'sql' => $sql, + 'groups_with_subgroups' => groups_with_subgroups($group, $subgroup), + 'notes' => $notes, + 'cache_expiry' => $cache_expiry, + 'public' => $public, + 'usecache' => $usecache, ); } } -- 2.39.5