Bug 8203: Add ability to save individual authorities
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / authorities-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             $("#newmenuc").empty();
9             $("#delAuthc").empty();
10         $("#savemenuc").empty();
11             yuiToolbar();
12          });
13
14         // YUI Toolbar Functions
15
16         function yuiToolbar() {   
17         
18                 var newmenu = [
19                         [% FOREACH authtypesloo IN authtypesloop %]{ text: "[% authtypesloo.authtypetext %]", url: "/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authtypesloo.value %]"},
20 [% END %]
21                 ]
22
23             new YAHOO.widget.Button({
24                 type: "menu",
25             label: _("New authority"),
26                 name: "newmenubutton",
27                 menu: newmenu,
28                 container: "newmenuc"
29             });  
30                 
31                 var editButton = new YAHOO.widget.Button("editAuth");
32                 
33                 var delAuthButton = new YAHOO.widget.Button({
34           id: "delAuth", 
35           type: "button", 
36           label: _("Delete"), 
37           container: "delAuthc",
38                   onclick: {fn: confirm_deletion }
39         });
40
41         var savemenu = [
42             { text: _("MADS (XML)"), url: "/cgi-bin/koha/authorities/export.pl?format=mads&op=export&authid=[% authid %]" },
43             { text: _("MARCXML"), url: "/cgi-bin/koha/authorities/export.pl?format=marcxml&op=export&authid=[% authid %]" },
44             { text: _("MARC (non-Unicode/MARC-8)"), url: "/cgi-bin/koha/authorities/export.pl?format=marc8&op=export&authid=[% authid %]" },
45             { text: _("MARC (Unicode/UTF-8)"), url: "/cgi-bin/koha/authorities/export.pl?format=utf8&op=export&authid=[% authid %]" },
46         ];
47
48         new YAHOO.widget.Button({
49             type: "menu",
50             label: _("Save"),
51             id: "savemenuc",
52             name: "savemenubutton",
53             menu: savemenu,
54             container: "savemenuc"
55         });
56         }
57
58         //]]>
59         </script>
60   <form name="f2" method="post" action="authorities.pl">        
61   
62 [% IF ( authid ) %]  <a id="editAuth" href="authorities.pl?authid=[% authid %]">Edit</a>
63     
64     [% UNLESS ( count ) %]
65     <span id="delAuthc"><a id="delAuth" href="javascript:confirm_deletion()">Delete</a></span>
66     [% END %]
67     <span id="savemenuc">Save</span>
68 [% ELSE %]&nbsp;[% END %]
69   
70   <span id="newmenuc">
71         <label for="add_authtypecode">New: </label>
72         <select id="add_authtypecode" name="authtypecode">
73 [% FOREACH authtypesloo IN authtypesloop %]
74   [% IF ( authtypesloo.selected ) %]
75         <option value="[% authtypesloo.value %]" selected="selected">[% authtypesloo.authtypetext %]</option>
76   [% ELSE %]
77         <option value="[% authtypesloo.value %]">[% authtypesloo.authtypetext %]</option>
78   [% END %]
79 [% END %]
80         </select>
81       <input type="submit" value="Add" class="button" />
82   </span></form>
83 </div>