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 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
e1372bacdf
commit
4daf0b7982
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in New Issue