1 <script type="text/javascript">
3 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
4 /* this function open a popup to search on z3950 server. */
5 function PopupZ3950() {
6 var strQuery = GetZ3950Terms();
8 window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
11 function PopupZ3950Confirmed() {
12 if (confirm(_("Please note that this external search could replace the current record."))){
17 /* provide Z3950 search points */
18 function GetZ3950Terms(){
19 var strQuery="&frameworkcode=";
20 [% FOREACH z3950_search_param IN z3950_search_params %]
21 strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
26 function addToCart() { addRecord('[% biblionumber %]'); }
27 function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes');
29 function printBiblio() {window.print(); }
30 [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
31 function confirm_deletion() {
32 var count = [% count %];
33 var holdcount = [% holdcount %];
34 var countorders = [% countorders %];
35 var countdeletedorders = [% countdeletedorders %];
38 is_confirmed = alert( _("%s item(s) are attached to this record. You must delete all items before deleting this record.").format(count) );
40 else if (countorders > 0){
41 [% IF ( CAN_user_acquisition_order_manage ) %]
42 is_confirmed = confirm( _("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?").format(countorders) );
44 is_confirmed = alert( _("%s order(s) are using this record. You need order managing permissions to delete this record.").format(countorders) );
47 else if (countdeletedorders > 0){
48 [% IF ( CAN_user_acquisition_order_manage ) %]
49 is_confirmed = confirm( _("%s deleted order(s) are using this record. Are you sure you want to delete this record?").format(countdeletedorders) );
51 is_confirmed = alert( _("%s deleted order(s) are using this record. You need order managing permissions to delete this record.").format(countdeletedorders) );
54 else if ( holdcount > 0 ) {
55 is_confirmed = confirm( _("%s holds(s) for this record. Are you sure you want to delete this record?").format(holdcount) );
57 is_confirmed = confirm(_("Are you sure you want to delete this record?"));
60 window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]";
67 [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
68 function confirm_items_deletion() {
69 var count = [% count %];
70 var holdcount = [% holdcount %];
72 if ( holdcount > 0 ) {
73 alert( _("%s hold(s) on this record. You must delete all holds before deleting all items.").format(holdcount) );
74 } else if ( count > 0 ) {
75 if( confirm( _("Are you sure you want to delete the %s attached items?").format(count) ) ) {
76 window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]";
85 function alertNoItems(){
86 alert(_("This record has no items."));
89 $(document).ready(function() {
90 $("#z3950copy").click(function(){
94 $("#deletebiblio").click(function(){
98 $("#deleteallitems").click(function(){
99 confirm_items_deletion();
102 $("#printbiblio").click(function(){
106 $("#addtocart").click(function(){
108 $(".btn-group").removeClass("open");
111 $("#addtoshelf").click(function(){
113 $(".btn-group").removeClass("open");
116 $("#export").remove(); // Hide embedded export form if JS menus available
117 $("#deletebiblio").tooltip();
118 $("#batchedit-disabled,#batchdelete-disabled,#deleteallitems-disabled")
119 .on("click",function(e){
128 <div id="toolbar" class="btn-toolbar">
130 <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addbiblio.pl" onsubmit="return Check();">
132 [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ||
133 CAN_user_serials_create_subscription ) %]
134 <div class="btn-group">
135 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button>
136 <ul class="dropdown-menu">
137 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
138 <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
141 [% IF ( CAN_user_editcatalogue_edit_items ) %]
142 <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema">New item</a></li>
144 [% IF ( CAN_user_serials_create_subscription ) %]
145 <li><a id="newsub" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]">New subscription</a></li>
148 [% IF ( EasyAnalyticalRecords && CAN_user_editcatalogue_edit_catalogue ) %]
149 <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&analyze=1">Analyze items</a></li>
151 [% IF CAN_user_editcatalogue_edit_catalogue && ! EasyAnalyticalRecords %]
152 <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber %]">New child record</a></li>
158 [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
159 <div class="btn-group">
160 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-pencil"></i> Edit <span class="caret"></span></button>
161 <ul class="dropdown-menu">
162 [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
163 <li><a id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=[% current_framework %]&op=">Edit record</a></li>
166 [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
167 <li><a id="edititems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Edit items</a></li>
170 [% IF ( CAN_user_tools_items_batchmod ) %]
172 <li><a id="batchedit" href="/cgi-bin/koha/tools/batchMod.pl?op=show&biblionumber=[% biblionumber %]&src=CATALOGUING">Edit items in batch</a></li>
174 <li class="disabled"><a id="batchedit-disabled" href="#" data-toggle="tooltip" data-placement="left" title="This record has no items">Edit items in batch</a></li>
178 [% IF ( CAN_user_tools_items_batchdel ) %]
180 <li><a id="batchdelete" href="/cgi-bin/koha/tools/batchMod.pl?del=1&op=show&biblionumber=[% biblionumber %]&src=CATALOGUING">Delete items in a batch</a></li>
182 <li class="disabled"><a id="batchdelete-disabled" href="#" data-toggle="tooltip" data-placement="left" title="This record has no items">Delete items in a batch</a></li>
186 [% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">Attach item</a></li>[% END %]
188 [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]">Link to host item</a>[% END %][% END %]
189 [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image">Upload image</a>[% END %][% END %]
191 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
192 <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=[% current_framework %]&op=duplicate">Edit as new (duplicate)</a></li>
193 <li><a href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li>
196 [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
198 <li class="disabled"><a id="deletebiblio" data-toggle="tooltip" data-placement="left" title="[% count %] item(s) are attached to this record. You must delete all items before deleting this record." href="#">Delete record</a></li>
200 <li><a id="deletebiblio" href="#">Delete record</a></li>
204 [% IF CAN_user_editcatalogue_delete_all_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
206 <li><a href="#" id="deleteallitems">Delete all items</a></li>
208 <li class="disabled"><a href="#" id="deleteallitems-disabled" data-toggle="tooltip" data-placement="left" title="This record has no items">Delete all items</a></li>
216 <div class="btn-group">
217 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-download"></i> Save <span class="caret"></span></button>
218 <ul class="dropdown-menu">
219 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=bibtex&op=export&bib=[% biblionumber %]">BIBTEX</a></li>
220 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=dc&op=export&bib=[% biblionumber %]">Dublin Core (XML)</a></li>
221 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=marcxml&op=export&bib=[% biblionumber %]">MARCXML</a></li>
222 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=marc8&op=export&bib=[% biblionumber %]">MARC (non-Unicode/MARC-8)</a></li>
223 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=utf8&op=export&bib=[% biblionumber %]">MARC (Unicode/UTF-8)</a></li>
224 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=marcstd&op=export&bib=[% biblionumber %]">MARC (Unicode/UTF-8, Standard)</a></li>
225 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=mods&op=export&bib=[% biblionumber %]">MODS (XML)</a></li>
226 <li><a href="/cgi-bin/koha/catalogue/export.pl?format=ris&op=export&bib=[% biblionumber %]">RIS</a></li>
230 [% IF ( virtualshelves && intranetbookbag ) %]
231 <div class="btn-group">
232 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">Add to <span class="caret"></span></button>
233 <ul class="dropdown-menu">
234 <li><a href="#" id="addtocart">Cart</a></li>
235 <li><a href="#" id="addtoshelf">List</a></li>
238 [% ELSIF ( virtualshelves ) %]
239 <div class="btn-group"><a id="addtoshelf" class="btn btn-small"><i class="fa fa-list"></i> Add to list</a> </div>
240 [% ELSIF ( intranetbookbag ) %]
241 <div class="btn-group"><a id="addtocart" class="btn btn-small"><i class="fa fa-shopping-cart"></i> Add to cart</a> </div>
244 <div class="btn-group"><a id="printbiblio" class="btn btn-small"><i class="fa fa-print"></i> Print</a></div>
246 [% IF ( CAN_user_reserveforothers ) %]
247 [% UNLESS ( norequests ) %]
249 <div class="btn-group">
250 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">
251 <i class="fa fa-hold"></i>
253 <span class="caret"></span>
255 <ul class="dropdown-menu">
256 <li><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">Place hold</a></li>
257 <li><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]&findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></li>
261 <div class="btn-group"><a id="placehold" class="btn btn-small" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]"><i class="fa fa-hold"></i> Place hold</a></div>