Bug 16388: Move option to download report into 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 || runreport ) %]
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 |uri %]&amp;reportname=[% reportname |uri %]&amp;notes=[% notes |uri %]">
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="delete btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Delete%20Saved">
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
49         [% IF ( runreport ) %]
50             <div class="btn-group">
51                 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown" id="format"><i class="fa fa-upload"></i> Download <span class="caret"></span></button>
52                 <ul class="dropdown-menu">
53                     <li><a id="csv" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=csv&amp;sql=[% sql |uri %]&amp;reportname=[% name |uri %]">Comma separated text</a></li>
54                     <li><a id="tab" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=tab&amp;sql=[% sql |uri %]&amp;reportname=[% name |uri %]">Tab separated text</a></li>
55                     <li><a id="ods" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=ods&amp;sql=[% sql |uri %]&amp;reportname=[% name |uri %]">Open Document Spreadsheet</a></li>
56                 </ul>
57             </div>
58         [% END %]
59
60     [% END %]
61 </div>
62
63 <script type="text/javascript">
64 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone.");
65
66 $(document).ready(function(){
67     $(".delete").on("click",function(){
68         return confirmDelete(MSG_CONFIRM_DELETE);
69     });
70 });
71 </script>