Owen Leonard
8aec387198
This patch corrects a problem with the reports toolbar include file which can cause a problem with the "duplicate" button. The duplicate button passes the entire report SQL as a URL parameter, but the template variable was not escaped as a URL variable. This patch also adds the "uri" filter to the report name and notes fields just to be safe. To reproduce the bug, create a new SQL report using the SQL in the bug report. When you run the report you should see a broken "Duplicate" button. Apply the patch and run the report again. The duplicate button should look correct and work correctly. Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
59 lines
2.7 KiB
HTML
59 lines
2.7 KiB
HTML
<div id="toolbar" class="btn-toolbar">
|
|
[% IF ( CAN_user_reports_create_reports ) %]
|
|
<div class="btn-group">
|
|
<button class="btn btn-small 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-small" 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-small" title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% sql |uri %]&reportname=[% reportname |uri %]&notes=[% notes |uri %]">
|
|
<i class="fa fa-copy"></i> Duplicate
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( CAN_user_reports_create_reports ) %]
|
|
<div class="btn-group">
|
|
<a class="delete btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Delete%20Saved">
|
|
<i class="fa fa-remove"></i> Delete
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% UNLESS ( errors ) # Unless there are errors saving a report %]
|
|
<div class="btn-group">
|
|
<a id="runreport" class="btn btn-small" 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-small" href="/cgi-bin/koha/tools/scheduler.pl?id=[% id %]">
|
|
<i class="fa fa-clock-o"></i> Schedule
|
|
</a>
|
|
</div>
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone.");
|
|
|
|
$(document).ready(function(){
|
|
$(".delete").on("click",function(){
|
|
return confirmDelete(MSG_CONFIRM_DELETE);
|
|
});
|
|
});
|
|
</script>
|