Merge remote branch 'kc/new/biblibre_reports' 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         <!-- TMPL_IF NAME="viewshelf" --> function sendList(){
18                 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=<!-- TMPL_VAR NAME="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=<!-- TMPL_VAR NAME="shelfnumber" -->','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
23          }<!-- /TMPL_IF -->
24
25         // YUI Toolbar Functions
26
27         function yuiToolbar() {
28                     newshelfButton = new YAHOO.widget.Button("newshelf");
29                     <!-- TMPL_IF NAME="viewshelf" --><!-- TMPL_IF name="manageshelf" -->editshelfButton = new YAHOO.widget.Button("editshelf");
30                         
31             var editmenu = [
32                 { text: _("Edit list"), url: "/cgi-bin/koha/virtualshelves/shelves.pl?shelfnumber=<!-- TMPL_VAR NAME="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=<!-- TMPL_VAR NAME="shelfnumber" -->" },
38                 { text: _("RIS"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=ris&shelfid=<!-- TMPL_VAR NAME="shelfnumber" -->" },
39                 { text: _("BibTex"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=bibtex&shelfid=<!-- TMPL_VAR NAME="shelfnumber" -->" },
40 <!-- TMPL_LOOP NAME="csv_profiles" -->
41                 { text: _("CSV - <!-- TMPL_VAR NAME="profile" -->"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=<!-- TMPL_VAR NAME="export_format_id" -->&shelfid=<!-- TMPL_VAR NAME="shelfnumber" -->" },
42 <!-- /TMPL_LOOP -->
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 <!-- /TMPL_IF -->
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                                         });<!-- /TMPL_IF -->
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         <!-- TMPL_IF NAME="viewshelf" --><!-- TMPL_IF name="manageshelf" -->
91         <li id="editlistc"><a id="editshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelfnumber=<!-- TMPL_VAR NAME="shelfnumber" -->&amp;op=modif">Edit list</a></li>
92         <li id="deletelistc"><!-- TMPL_IF NAME="showprivateshelves" --><a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves&amp;shelves=1&amp;DEL-<!-- TMPL_VAR NAME="shelfnumber" -->=1">Delete list</a><!-- TMPL_ELSE --><a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1&amp;DEL-<!-- TMPL_VAR NAME="shelfnumber" -->=1">Delete list</a><!-- /TMPL_IF --></li>
93         <!-- /TMPL_IF -->
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         <!-- /TMPL_IF -->
97 </ul>
98 </div>
99