Nick Clemens
8acf5912b3
This patch combines report paramters with the same name and data type (authorised value) This presereves the past ability to provide all parameters as 'sql_params' in order to preserve existing public report links To test: 1 - Create a report that takes multiple parameters, e.g.: SELECT <<cat>> AS one, <<dog|branches>> AS two, <<dog|YES_NO>> as three, <<cat>> as four, <<dog|branches>> as five 2 - Run this report, note you are asked for five parameters 3 - Apply patch 4 - Update database 5 - Run report, note you are asked for three params 6 - Verify the results reflect the supplied parameters 7 - Export the report and verify results 8 - Alter the URL and provide 5 params as sql_params and no param_name variables i.e. http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run+this+report&sql_params=Banana&sql_params=CPL&sql_params=0&sql_params=Orange&sql_params=LPL 9 - Verify results come out as expected. i.e. 5 different values that are those of the URL. Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
72 lines
4.1 KiB
HTML
72 lines
4.1 KiB
HTML
[% INCLUDE 'blocking_errors.inc' %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
[% IF ( CAN_user_reports_create_reports ) %]
|
|
<div class="btn-group">
|
|
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New report <span class="caret"></span></button>
|
|
<ul class="dropdown-menu">
|
|
<li id="newmenuc"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">New guided report</a> </li>
|
|
<li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
|
|
</ul>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( showsql || execute || editsql || save_successful ) %]
|
|
[% IF ( CAN_user_reports_create_reports ) %]
|
|
[% UNLESS ( editsql ) # Do not show edit button on edit page %]
|
|
<div class="btn-group">
|
|
<a id="editreport" class="btn btn-default btn-sm" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Edit%20SQL">
|
|
<i class="fa fa-pencil"></i> Edit
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
<div class="btn-group">
|
|
<a class="btn btn-default btn-sm" title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% original_sql || sql |uri %]&reportname=[% reportname |uri %]&notes=[% notes |uri %]">
|
|
<i class="fa fa-copy"></i> Duplicate
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( CAN_user_reports_delete_reports ) %]
|
|
<div class="btn-group">
|
|
<a class="delete btn btn-default btn-sm" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Delete%20Saved">
|
|
<i class="fa fa-trash"></i> Delete
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% UNLESS ( errors ) # Unless there are errors saving a report %]
|
|
<div class="btn-group">
|
|
<a id="runreport" class="btn btn-default btn-sm" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Run%20this%20report">
|
|
<i class="fa fa-play"></i> Run report
|
|
</a>
|
|
</div>
|
|
<div class="btn-group">
|
|
<a class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/scheduler.pl?id=[% id %]">
|
|
<i class="fa fa-clock-o"></i> Schedule
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( execute ) %]
|
|
[% BLOCK params %]
|
|
[%- FOREACH param IN sql_params %]&sql_params=[% param %][% END %]
|
|
[%- FOREACH param_name IN param_names %]&param_name=[% param_name %][% END %]
|
|
[%- END %]
|
|
|
|
|
|
<div class="btn-group">
|
|
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="format"><i class="fa fa-upload"></i> Download <span class="caret"></span></button>
|
|
<ul class="dropdown-menu">
|
|
<li><a id="csv" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&format=csv&report_id=[% id %]&reportname=[% name |uri %][% PROCESS params %]">[% PROCESS 'delimiter_text.inc' %]</a></li>
|
|
<li><a id="tab" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&format=tab&report_id=[% id %]&reportname=[% name |uri %][% PROCESS params %]">Tab separated text</a></li>
|
|
<li><a id="ods" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&format=ods&report_id=[% id %]&reportname=[% name |uri %][% PROCESS params %]">Open Document Spreadsheet</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="btn-group">
|
|
<a class="btn btn-default btn-sm toggle_sql" id="toggle_sql_hid" href="#"><i class="fa fa-eye"></i> Show SQL code</a>
|
|
<a class="btn btn-default btn-sm toggle_sql" id="toggle_sql_vis" href="#" style="display:none;"><i class="fa fa-eye-slash"></i> Hide SQL code</a>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% END %]
|
|
</div>
|