Koha/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc
Aleisha 181a85fe15 Bug 13132: Add confirm dialog for deleting reports from the reports toolbar
To test:

1) Go to Reports -> Use saved (or build a new one if you have none saved)
2) Click on the Actions drop down and confirm that when you click Delete from here, a confirm message shows up. Click Cancel.
3) Click Show in the drop down menu
4) Click Delete in the Reports toolbar. Confirm you now get a confirm message. Clicking Cancel will cancel the delete, and clicking OK deletes the report and takes you to the saved reports page.

Spponsored-by: Catalyst IT
Signed-off-by: Magnus Enger <magnus@libriotech.no>
After applying the patch I get a JavaScript popup confirmation when
I click on the delete button, in the Show, Edit and Run views. Nice!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-31 18:50:54 +00:00

53 lines
2.6 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 %]&amp;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&amp;sql=[% sql %]&amp;reportname=[% reportname %]&amp;notes=[% notes %]">
<i class="fa fa-copy"></i> Duplicate
</a>
</div>
[% END %]
[% IF ( CAN_user_reports_create_reports ) %]
<div class="btn-group">
<a class="confirmdelete btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Delete%20Saved" onclick="return confirm(MSG_CONFIRM_DELETE);">
<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 %]&amp;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.");
</script>