Merge remote-tracking branch 'kc/new/bug_6094' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / virtualshelves-toolbar.inc
1 <div id="toolbar">
2         <script type="text/javascript">
3         //<![CDATA[
4
5         // prepare DOM for YUI Toolbar
6
7          $(document).ready(function() {
8                 $("#editlistc").empty();
9                 $("#deletelistc").remove();
10                 $("#sendlistc").empty();
11                 $("#downloadlistc").empty();
12                 $("#printlistc").empty();
13                 $("#sendlistc").before("<li id=\"downloadmenuc\"><\/li>");
14             yuiToolbar();
15          });
16          
17         [% IF ( viewshelf ) %] function sendList(){
18                 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
19          }
20          
21          function downloadList(){
22                 open(CGIBIN+'virtualshelves/downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
23          }[% END %]
24
25         // YUI Toolbar Functions
26
27         function yuiToolbar() {
28                     newshelfButton = new YAHOO.widget.Button("newshelf");
29                     [% IF ( viewshelf ) %][% IF ( manageshelf ) %]editshelfButton = new YAHOO.widget.Button("editshelf");
30                         
31             var editmenu = [
32                 { text: _("Edit list"), url: "/cgi-bin/koha/virtualshelves/shelves.pl?shelfnumber=[% shelfnumber %]&amp;op=modif" },
33                         { text: _("Delete list"), onclick: {fn:function(){confirmDelete(_("Are you sure you want to delete this list?"))}}}
34             ];
35                 
36                 var downloadmenu = [
37                 { text: _("iso2709"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=iso2709&shelfid=[% shelfnumber %]" },
38                 { text: _("RIS"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=ris&shelfid=[% shelfnumber %]" },
39                 { text: _("BibTex"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=bibtex&shelfid=[% shelfnumber %]" },
40 [% FOREACH csv_profile IN csv_profiles %]
41                 { text: _("CSV - [% csv_profile.profile %]"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=[% csv_profile.export_format_id %]&shelfid=[% csv_profile.shelfnumber %]" },
42 [% END %]
43                 ];
44
45             new YAHOO.widget.Button({
46                 type: "menu",
47                 label: _("Download list"),
48                 name: "downloadmenubutton",
49                 menu: downloadmenu,
50                 container: "downloadmenuc"
51             });
52
53                 new YAHOO.widget.Button({
54                 type: "menu",
55                 label: _("Edit"),
56                 name: "editmenubutton",
57                 menu: editmenu,
58                 container: "editlistc"
59             });
60
61 [% END %]
62                         downloadlistButton = new YAHOO.widget.Button({
63                                             id: "downloadlist", 
64                                             type: "button", 
65                                             label: _("Download list"), 
66                                             container: "downloadlistc",
67                                                                                         onclick: {fn:downloadList}
68                                         });
69                         sendlistButton = new YAHOO.widget.Button({
70                                             id: "sendlist", 
71                                             type: "button", 
72                                             label: _("Send list"), 
73                                             container: "sendlistc",
74                                                                                         onclick: {fn:sendList}
75                                         });
76                         printlistButton = new YAHOO.widget.Button({
77                                             id: "printbiblio", 
78                                             type: "button", 
79                                             label: _("Print list"), 
80                                             container: "printlistc",
81                                                                                         onclick: {fn:function(){print();}}
82                                         });[% END %]
83         }
84
85         //]]>
86         </script>
87         
88 <ul class="toolbar">
89         <li><a id="newshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1">New list</a></li>
90         [% IF ( viewshelf ) %][% IF ( manageshelf ) %]
91         <li id="editlistc"><a id="editshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelfnumber=[% shelfnumber %]&amp;op=modif">Edit list</a></li>
92         <li id="deletelistc">[% IF ( showprivateshelves ) %]<a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves&amp;shelves=1&amp;DEL-[% shelfnumber %]=1">Delete list</a>[% ELSE %]<a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1&amp;DEL-[% shelfnumber %]=1">Delete list</a>[% END %]</li>
93         [% END %]
94         <li id="sendlistc"><a href="#" id="sendlist">Send list</a></li>
95         <li id="printlistc"><a id="printbiblio" href="#">Print list</a></li>
96         [% END %]
97 </ul>
98 </div>
99