Bugzilla – Attachment 137764 Details for
Bug 23824
Add a 'Save and run' button to reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23824: Add a Save and Run button to reports
0001-Bug-23824-Add-a-Save-and-Run-button-to-exports.patch (text/plain), 6.25 KB, created by
Michal Urban
on 2022-07-15 14:24:06 UTC
(
hide
)
Description:
Bug 23824: Add a Save and Run button to reports
Filename:
MIME Type:
Creator:
Michal Urban
Created:
2022-07-15 14:24:06 UTC
Size:
6.25 KB
patch
obsolete
>From 6cc7510fc57279c3dd2a5c9db1ecde82a55b5385 Mon Sep 17 00:00:00 2001 >From: Michal Urban <michalurban177@gmail.com> >Date: Tue, 12 Jul 2022 18:31:47 -0400 >Subject: [PATCH] Bug 23824: Add a Save and Run button to exports > >Added a setting within the Guided SQL Reports create and edit report interfaces. > >This allows admins to bypass the need to go to the Edit SQL page to run reports and run a report after saving. > >To test: >1. Navigate to the reports screen in Koha admin, and create a SQL report >2. Create a report with "Run report after saving" switched to "Yes", save the report >(Easy query for testing: "SELECT NOW();") >3. Notice that the report runs after saving >4. Navigate to the edit page for the report, edit the query, set "Run report after saving" to yes and update SQL >5. Notice that the report runs after updating in the Edit SQL page >6. Create a new report with "Run report after saving" set to "No", and save >7. Notice that you are redirected to the Edit SQL page >8. Edit the query with "Run report after saving" set to "No" and update SQL >9. Notice that the SQL updates and does not run >--- > .../modules/reports/guided_reports_start.tt | 36 +++++++++++++++++++ > reports/guided_reports.pl | 4 +++ > 2 files changed, 40 insertions(+) > >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 9551980fb2..13f2274b0b 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 >@@ -1248,6 +1248,24 @@ > <label for="notes">Notes:</label> > <textarea id="notes" name="notes" cols="50" rows="2">[% notes | html %]</textarea> > </li> >+ >+ [% IF (save_and_run) %] >+ <li> >+ <label for="save_and_run">Run report after saving:</label> >+ <select id="save_and_run" name="save_and_run"> >+ <option value="0">No (default)</option> >+ <option value="1" selected="selected">Yes</option> >+ </select> >+ </li> >+ [% ELSE %] >+ <li> >+ <label for="save_and_run">Run report after saving:</label> >+ <select id="save_and_run" name="save_and_run"> >+ <option value="0" selected="selected">No (default)</option> >+ <option value="1">Yes</option> >+ </select> >+ </li> >+ [% END # /IF (save_and_run) %] > </ol> > </fieldset> <!-- /.rows --> > >@@ -1360,6 +1378,24 @@ > <label for="notes">Notes:</label> > <textarea id="notes" name="notes" cols="50" rows="2">[% notes | html %]</textarea> > </li> >+ >+ [% IF (save_and_run) %] >+ <li> >+ <label for="save_and_run">Run report after saving:</label> >+ <select id="save_and_run" name="save_and_run"> >+ <option value="0">No (default)</option> >+ <option value="1" selected="selected">Yes</option> >+ </select> >+ </li> >+ [% ELSE %] >+ <li> >+ <label for="save_and_run">Run report after saving:</label> >+ <select id="save_and_run" name="save_and_run"> >+ <option value="0" selected="selected">No (default)</option> >+ <option value="1">Yes</option> >+ </select> >+ </li> >+ [% END # /IF (save_and_run) %] > </ol> > </fieldset> <!-- /.rows --> > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index c497dcc0a7..d27ad7b696 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -219,6 +219,7 @@ elsif ( $phase eq 'Update SQL'){ > my $cache_expiry_units = $input->param('cache_expiry_units'); > my $public = $input->param('public'); > my $save_anyway = $input->param('save_anyway'); >+ my $save_and_run = $input->param('save_and_run'); > my @errors; > > # if we have the units, then we came from creating a report from SQL and thus need to handle converting units >@@ -291,6 +292,7 @@ elsif ( $phase eq 'Update SQL'){ > 'usecache' => $usecache, > ); > logaction( "REPORTS", "MODIFY", $id, "$reportname | $sql" ) if C4::Context->preference("ReportsLog"); >+ print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?reports=".$id."phase=Run%20this%20report") if $save_and_run; > } > if ( $usecache ) { > $template->param( >@@ -576,6 +578,7 @@ elsif ( $phase eq 'Save Report' ) { > my $cache_expiry_units = $input->param('cache_expiry_units'); > my $public = $input->param('public'); > my $save_anyway = $input->param('save_anyway'); >+ my $save_and_run = $input->param('save_and_run'); > > > # if we have the units, then we came from creating a report from SQL and thus need to handle converting units >@@ -661,6 +664,7 @@ elsif ( $phase eq 'Save Report' ) { > 'public' => $public, > 'usecache' => $usecache, > ); >+ print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?reports=".$id."phase=Run%20this%20report") if $save_and_run; > } > } > } >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23824
:
137764
|
149080
|
149433
|
149724