Merge remote-tracking branch 'origin/new/bug_5347'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / reports-toolbar.inc
1 [% UNLESS ( no_add ) %]
2 <div id="toolbar">
3         <script type="text/javascript">
4         //<![CDATA[
5          $(document).ready(function() {
6                 $("#newmenuc").empty();
7                 $("#newsql").remove();
8                 yuiToolbar();
9          });
10
11         // YUI Toolbar Functions
12         function yuiToolbar() {
13         [% IF ( CAN_user_reports_create_reports ) %]
14                 var newmenu = [
15                         { text: _("Guided report"),  url: "/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new" },
16                         { text: _("SQL report"),  url: "/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL" }
17                 ]
18             new YAHOO.widget.Button({
19                 type: "menu",
20                 label: _("New"),
21                 name: "newmenubutton",
22                 menu: newmenu,
23                 container: "newmenuc"
24             });
25             new YAHOO.widget.Button("editreport");[% END %]
26             new YAHOO.widget.Button("runreport");
27         }
28         //]]>
29         </script>
30
31         <ul class="toolbar">
32                 [% IF ( CAN_user_reports_create_reports ) %]<li id="newmenuc"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">New guided report</a> </li>[% END %]
33                 <li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
34                 [% IF ( showsql || execute || editsql || save_successful ) %]
35                         [% UNLESS ( errors ) %][%# Unless there are errors saving a report %]
36                                 [% UNLESS ( editsql ) %][%# Do not show edit button on edit page %]
37                                         [% IF ( CAN_user_reports_create_reports ) %]<li><a id="editreport" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Edit%20SQL">Edit</a></li>[% END %]
38                                 [% END %]
39                                 <li><a id="runreport" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&amp;phase=Run%20this%20report">Run report</a></li>
40                         [% END %]
41                 [% END %]
42         </ul>
43 </div>
44 [% END %]