From 2ea5163970fad485d3dd37c715966fe5d73bf3cc 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 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 Signed-off-by: Laura Escamilla Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../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 cc14f25773..363890a229 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 @@ -1324,7 +1324,6 @@ [% IF ( editsql ) %]
-

Edit SQL report

@@ -1382,7 +1381,8 @@
- + + Cancel
diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 94cff9fe21..fb51ab27fa 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.39.5