Bugzilla – Attachment 179136 Details for
Bug 39298
Runtime parameters don't work with report templates on first run
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39298: Add runtime parameter support to report templates
Bug-39298-Add-runtime-parameter-support-to-report-.patch (text/plain), 2.49 KB, created by
David Cook
on 2025-03-11 05:03:51 UTC
(
hide
)
Description:
Bug 39298: Add runtime parameter support to report templates
Filename:
MIME Type:
Creator:
David Cook
Created:
2025-03-11 05:03:51 UTC
Size:
2.49 KB
patch
obsolete
>From 620d1e9cc1afd3d0d7620b4324e5ed101b530ce2 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 11 Mar 2025 05:00:18 +0000 >Subject: [PATCH] Bug 39298: Add runtime parameter support to report templates > >This change makes it so that you can provide runtime parameters >and use "Run with template". > >Test plan: >0. Apply the patch and koha-plack --restart kohadev >1. Create a report template. For example: ><table> ><tr><th>Transformed Biblionumber</th></tr> >[% FOREACH row IN data %] ><tr><td>Biblionumber [% row.biblionumber %]</td></tr> >[% END %] ></table> >2. Create a SQL report with a runtime parameter. For example: >SELECT biblionumber >FROM biblio >WHERE biblionumber > <<biblionumber>> >3. Run the report using "Run with template" >4. Specify a biblionumber of 1 >5. Click "Run the report" >6. Note that the output is the template output and not regular >SQL output >--- > .../prog/en/modules/reports/guided_reports_start.tt | 3 +++ > reports/guided_reports.pl | 1 + > 2 files changed, 4 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 55afc39ff0..6eda1b2063 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 >@@ -926,6 +926,9 @@ > <!-- /.rows --> > <fieldset class="action"> > <input type="hidden" name="op" value="run" /> >+ [% IF ( template_id ) %] >+ <input type="hidden" name="template" value="[% template_id %]" /> >+ [% END %] > <button type="submit" class="btn btn-primary">Run the report</button> > </fieldset> > </form> >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 70196334d9..901e11faf0 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -971,6 +971,7 @@ if ( $op eq 'run' ) { > 'auth_val_errors' => \@authval_errors, > 'enter_params' => 1, > 'id' => $report_id, >+ 'template_id' => $template_id, > ); > } else { > my ( $sql, $header_types ) = $report->prep_report( \@param_names, \@sql_params ); >-- >2.39.5
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 39298
:
179136
|
179145
|
180354
|
180355