Bug 13132: Add confirm dialog for deleting reports from the reports toolbar
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / reports-toolbar.inc
1 <div id="toolbar" class="btn-toolbar">
2     [% IF ( CAN_user_reports_create_reports ) %]
3         <div class="btn-group">
4             <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New report <span class="caret"></span></button>
5             <ul class="dropdown-menu">
6                 <li id="newmenuc"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">New guided report</a> </li>
7                 <li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
8             </ul>
9         </div>
10     [% END %]
11
12     [% IF ( showsql || execute || editsql || save_successful ) %]
13         [% IF ( CAN_user_reports_create_reports ) %]
14             [% UNLESS ( editsql ) # Do not show edit button on edit page %]
15                 <div class="btn-group">
16                     <a id="editreport" class="btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Edit%20SQL">
17                         <i class="fa fa-pencil"></i> Edit
18                     </a>
19                 </div>
20             [% END %]
21             <div class="btn-group">
22                 <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 %]">
23                     <i class="fa fa-copy"></i> Duplicate
24                 </a>
25             </div>
26         [% END %]
27
28         [% IF ( CAN_user_reports_create_reports ) %]
29             <div class="btn-group">
30                 <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);">
31                     <i class="fa fa-remove"></i> Delete
32                 </a>
33             </div>
34         [% END %]
35
36         [% UNLESS ( errors ) # Unless there are errors saving a report %]
37             <div class="btn-group">
38                 <a id="runreport" class="btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Run%20this%20report">
39                     <i class="fa fa-play"></i> Run report
40                 </a>
41             </div>
42             <div class="btn-group">
43                 <a class="btn btn-small" href="/cgi-bin/koha/tools/scheduler.pl?id=[% id %]">
44                     <i class="fa fa-clock-o"></i> Schedule
45                 </a>
46             </div>
47         [% END %]
48     [% END %]
49 </div>
50
51 <script type="text/javascript">
52 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone.");
53 </script>