From bed9208a13c5984d110efda0cc0eb5c00588b9b8 Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Sat, 1 Apr 2023 11:27:26 +0200 Subject: [PATCH] Bug 23824: Add a "Save and run" button to reports [alternative] This will save one click every time you want to save and then run a report. To test: - Apply this patch - Create a new report - Click the new "Update and run SQL" button - Verify the report was saved and the results are displayed --- .../prog/en/modules/reports/guided_reports_start.tt | 4 ++-- reports/guided_reports.pl | 5 ++++- 2 files changed, 6 insertions(+), 3 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 3e30bc27d2..167712364f 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 @@ -1323,7 +1323,6 @@ [% IF ( editsql ) %]
-

Edit SQL report

@@ -1381,7 +1380,8 @@
- + + Cancel
diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index f4ed6cfdfc..8f7bdb0940 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -209,7 +209,7 @@ elsif ( $phase eq 'Edit SQL'){ ); } -elsif ( $phase eq 'Update SQL'){ +elsif ( $phase eq 'Update SQL' || $phase eq 'Update and run SQL' ){ my $id = $input->param('id'); my $sql = $input->param('sql'); my $reportname = $input->param('reportname'); @@ -301,6 +301,9 @@ elsif ( $phase eq 'Update SQL'){ cache_expiry_units => $cache_expiry_units, ); } + if ( $phase eq 'Update and run SQL' ) { + print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?reports=$id&phase=Run%20this%20report"); + } } } -- 2.34.1