8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › [% IF op == 'view' %]Lists › Contents of [% shelf.shelfname | html %][% ELSE %]Lists[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list [% shelf.shelfname | html %][% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/datatables.css") | $raw %]
12 <style>textarea { width: 100%; }</style>
14 [% BLOCK list_permissions %]
16 <label for="allow_changes_from">Allow changes to contents from: </label>
17 <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
19 [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
21 [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
22 <option value="1" selected="selected">Owner only</option>
24 <option value="1">Owner only</option>
27 [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
30   <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
35 <body id="lists_shelves" class="lists">
36 [% INCLUDE 'header.inc' %]
37 [% INCLUDE 'cat-search.inc' %]
39 <div id="breadcrumbs">
40 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
42 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
46 [% IF shelf AND shelf.is_private %] ›
47 [% IF op == 'view' OR op == 'edit_form' %]
48 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE | uri %]">Your lists</a>
52 [% ELSIF shelf AND shelf.is_public %] ›
54 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC | uri %]">Public lists</a>
60 [% IF op == 'view' %]› Contents of <i>[% shelf.shelfname | html %]</i>[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list <i>[% shelf.shelfname | html %]</i>[% END %]</div>
62 <div class="main container-fluid">
64 <div class="col-sm-10 col-sm-push-1">
67 [% INCLUDE 'virtualshelves-toolbar.inc' %]
69 [% FOR m IN messages %]
70 <div class="dialog [% m.type | html %]">
72 [% CASE 'error_on_update' %]
73 <span>An error occurred when updating this list.</span>
74 [% CASE 'error_on_insert' %]
75 <span>An error occurred when creating this list.</span>
76 [% CASE 'error_on_delete' %]
77 <span>An error occurred when deleting this list.</span>
78 [% CASE 'error_on_add_biblio' %]
79 [% IF m.item_barcode %]
80 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
82 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
84 [% CASE 'success_on_update' %]
85 <span>List updated.</span>
86 [% CASE 'success_on_insert' %]
87 <span>List created.</span>
88 [% CASE 'success_on_delete' %]
89 <span>List deleted.</span>
90 [% CASE 'success_on_add_biblio' %]
91 [% IF m.item_barcode %]
92 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
94 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
96 [% CASE 'success_on_remove_biblios' %]
97 <span>The item has been removed from the list.</span>
98 [% CASE 'does_not_exist' %]
99 <span>This list does not exist.</span>
100 [% CASE 'item_does_not_exist' %]
101 [% IF m.item_barcode %]
102 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
104 <span>The record ([% m.bibnum | html %]) does not exist.</span>
106 [% CASE 'unauthorized_on_view' %]
107 <span>You do not have permission to view this list.</span>
108 [% CASE 'unauthorized_on_update' %]
109 <span>You do not have permission to update this list.</span>
110 [% CASE 'unauthorized_on_delete' %]
111 <span>You do not have permission to delete this list.</span>
112 [% CASE 'unauthorized_on_add_biblio' %]
113 <span>You do not have permission to add a record to this list.</span>
114 [% CASE 'no_biblio_removed' %]
115 <span>No record was removed.</span>
116 [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
117 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
118 [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %]
119 <span>List could not be created. (Do not use the database administrator account.)</span>
120 [% CASE 'DBIx::Class::Exception' %]
123 [% m.code | html %] [% m.msg | html %]
128 [% IF op == 'view' %]
131 <h3>Contents of <i>[% shelf.shelfname | html %]</i></h3>
132 <div class="pages">[% pagination_bar | $raw %]</div>
133 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
134 <input type="hidden" name="op" value="remove_biblios" />
135 <input type="hidden" name="referer" value="view" />
136 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
138 [% IF direction == 'asc' %]
139 [% SET new_direction = 'desc' %]
141 [% SET direction = 'desc' %]
142 [% SET new_direction = 'asc' %]
146 <div id="searchheader" class="noprint">
147 <div id="selection_ops"><span class="checkall"></span> |
148 <span class="clearall"></span>
150 <span class="addto">| </span>
152 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
153 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
155 [% IF can_remove_biblios %]
156 <div class="btn-group"><button type="submit" class="btn btn-default btn-xs list-remove"><i class="fa fa-trash"></i> Remove selected</button></div>
158 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<div class="btn-group"><button type="submit" class="btn btn-default btn-xs merge-items"><i class="fa fa-compress"></i> Merge selected</button></div>[% END %]
163 <table id="searchresults">
165 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
167 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
169 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=title&direction=[% IF sortfield != 'title' %]asc[% ELSE %][% new_direction | uri %][% END %]">Title</a>
170 [% IF sortfield == 'title' %]
171 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
173 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
177 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=author&direction=[% IF sortfield != 'author' %]asc[% ELSE %][% new_direction | uri %][% END %]">Author</a>
178 [% IF sortfield == 'author' %]
179 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
181 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
185 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=dateadded&direction=[% IF sortfield != 'dateadded' %]asc[% ELSE %][% new_direction | uri %][% END %]">Date added</a>
186 [% IF sortfield == 'dateadded' %]
187 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
189 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
193 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=itemcallnumber&direction=[% IF sortfield != 'itemcallnumber' %]asc[% ELSE %][% new_direction | uri %][% END %]">Call number</a>
194 [% IF sortfield == 'itemcallnumber' %]
195 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
197 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
201 [% FOREACH itemsloo IN itemsloop %]
205 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
208 [% UNLESS ( item_level_itypes ) %]<td>
209 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />[% END %][% itemsloo.description | html %]
212 [% IF ( itemsloo.XSLTBloc ) %]
213 [% itemsloo.XSLTBloc | $raw %]
215 [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %]
216 [% itemsloo.title | html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield | html %][% END %]</a>
219 [% IF ( itemsloo.notforloan ) %]
220 <span class="noholdstext">No holds allowed</span>
222 [% IF ( itemsloo.ITEM_RESULTS.size ) %]
223 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
224 [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | uri %]&findborrower=[% holdfor_cardnumber | uri %]">Place hold for [% holdfor_firstname | html %] [% holdfor_surname | html %] ([% holdfor_cardnumber | html %])</a></span>[% END %]
226 <span class="noholdstext">No holds allowed</span>
229 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
230 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
232 [% IF ( CAN_user_editcatalogue_edit_items ) %]
233 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
237 <td>[% itemsloo.author | html %]</td>
238 <td>[% itemsloo.dateadded | $KohaDates%]</td>
241 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
242 <li>[% result.holdingbranch | html %] [% IF ( result.location_intranet ) %] ([% result.location_intranet | html %]) [% END %]
243 [% IF ( result.itemcallnumber ) %]
244 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>]
251 [% END %]<!-- /itemsloop -->
253 <div class="pages">[% pagination_bar | $raw %]</div>
259 [% IF op == 'add_form' OR op == 'edit_form' %]
261 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
262 <fieldset class="rows">
264 [% IF op == 'add_form' %]
265 <legend>Create a new list</legend>
266 <input type="hidden" name="op" value="add" />
268 <legend>Edit list <i>[% shelf.shelfname | html %]</i></legend>
269 <input type="hidden" name="op" value="edit" />
271 <input type="hidden" name="referer" value="[% referer | html %]" />
272 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
275 <label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelf.shelfname | html %]" required="required" class="required" />
276 <span class="required">Required</span>
279 <span class="label">Owner: </span>
280 [% IF op == 'add_form' %]
281 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
284 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
286 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
290 <li><label for="sortfield" >Sort this list by: </label>
291 <select name="sortfield">
292 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
293 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
294 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
295 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
296 [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
298 <li><label for="category">Category: </label>
299 <select id="category" name="category" onchange="AdjustRemark()">
300 [% IF shelf.is_private %]
301 <option value="1" selected="selected">Private</option>
303 <option value="1">Private</option>
305 [% IF shelf.is_public %]
306 <option value="2" selected="selected">Public</option>
308 <option value="2">Public</option>
312 [% INCLUDE list_permissions %]
317 <fieldset class="action">
318 <input type="submit" value="Save" class="submit" />
319 [% IF referer == 'view' %]
320 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
322 [% IF category == PUBLIC %]
323 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC | uri %]" class="cancel">Cancel</a>
325 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
333 [% IF op == 'list' %]
335 <div id="tabs" class="toptabs">
337 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
338 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
341 <div id="tab_content">
342 <table id="listresultst">
345 <th class="NoVisible">Type</th>
351 <th>Creation date</th>
352 <th>Modification date</th>
355 <tr class="filters_row">
357 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
360 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
362 <select class="filter text_filter" id="searchsortby_filter">
363 <option value=""></option>
364 <option value="title">Title</option>
365 <option value="author">Author</option>
366 <option value="copyrightdate">Copyrightdate</option>
367 <option value="itemcallnumber">Call number</option>
368 <option value="dateadded">Date added</option>
382 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
383 <!-- Value will be set here by placeHold() -->
384 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
385 <input type="hidden" name="multi_hold" value="1"/>
389 </div> <!-- /.col-sm-10.col-sm-push-2 -->
390 </div> <!-- /.row -->
392 [% IF ( can_add_biblios ) %]
394 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
395 <div class="modal-dialog" role="document">
396 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
397 <div class="modal-content">
398 <div class="modal-header">
399 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
400 <h4 class="modal-title" id="addToListLabel">Add items</h4>
402 <div class="modal-body">
403 <fieldset class="brief">
406 <label for="barcodes">Barcodes:</label>
407 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
408 <input type="hidden" name="op" value="add_biblio" />
409 <input type="hidden" name="referer" value="view" />
410 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
413 <label for="biblionumbers">Biblio numbers:</label>
414 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
415 <input type="hidden" name="op" value="add_biblio" />
416 <input type="hidden" name="referer" value="view" />
417 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
422 <div class="modal-footer">
423 <button type="submit" class="btn btn-default">Save</button>
424 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
432 [% MACRO jsinclude BLOCK %]
433 [% INCLUDE 'datatables.inc' %]
434 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
437 $( document ).ready(function() {
439 setTimeout('window.close()', 1);
444 [% IF op == 'view' %]
445 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
446 [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %]
449 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
450 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
451 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
453 [% IF op == 'list' %]
454 $(document).ready(function(){
455 [% IF category == PUBLIC %]
456 var type = [% PUBLIC | html %];
458 var type = [% PRIVATE | html %];
461 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
462 "aaSorting": [[ 5, "asc" ]],
464 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
465 'fnServerData': function(sSource, aoData, fnCallback) {
471 'value': $("#searchshelfname_filter").val(),
474 'value': $("#searchowner_filter").val(),
477 'value': $("#searchsortby_filter").val(),
479 'name': 'template_path',
480 'value': 'virtualshelves/tables/shelves_results.tt',
487 'success': function(json){
493 { 'mDataProp': 'dt_type' },
494 { 'mDataProp': 'dt_shelfname' },
495 { 'mDataProp': 'dt_count' },
496 { 'mDataProp': 'dt_is_shared' },
497 { 'mDataProp': 'dt_owner' },
498 { 'mDataProp': 'dt_sortby' },
499 { 'mDataProp': 'dt_created_on' },
500 { 'mDataProp': 'dt_modification_time' },
501 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
504 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
507 'sPaginationType': 'full_numbers',
510 "bSortCellsTop": true
513 dtListResults.fnAddFilters("filter", 750);
515 var tabs = $("#tabs").tabs({
516 [% IF category == PUBLIC %]
521 activate: function(e, ui) {
522 var active = tabs.tabs("option", "active" );
524 type = [% PRIVATE | html %];
525 dtListResults.fnDraw();
526 } else if ( active == 1 ) {
527 type = [% PUBLIC | html %];
528 dtListResults.fnDraw();
532 $("body").on("click", ".deleteshelf", function(){
533 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
538 [% IF shelf AND op == 'view' %]
539 $(document).ready(function(){
540 [% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %]
541 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
542 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
543 $("#CheckAll").click(function(){
544 $(".checkboxed").checkCheckboxes();
547 $("#CheckNone").click(function(){
548 $(".checkboxed").unCheckCheckboxes();
551 $(".placehold").on("click",function(e){
555 $(".addtocart").show();
556 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
557 [% IF ( intranetbookbag ) %]
558 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
560 [% IF Koha.Preference('virtualshelves') %]
561 [% IF add_to_some_private_shelves.count %]
562 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
563 [% SET number_of_private_shelves = 0 %]
564 [% FOREACH s IN add_to_some_private_shelves %]
565 [% IF shelfnumber != s.shelfnumber %]
566 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
567 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
568 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
571 param1 += "<\/optgroup>";
573 [% IF add_to_some_public_shelves.count %]
574 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
575 [% SET number_of_public_shelves = 0 %]
576 [% FOREACH s IN add_to_some_public_shelves %]
577 [% IF shelfnumber != s.shelfnumber %]
578 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
579 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
580 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
583 param1 += "<\/optgroup>";
585 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
586 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
588 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
590 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
591 $("span.addto").html(param1);
592 $("#cartsubmit").on("click",function(e){
596 $("#addto").change(function(){
599 $(".addto").find("input:submit").click(function(e){
603 $("#selection_ops").show();
604 $(".merge-items").on("click",function(e){
608 $("#listform").on("submit",function(e){
611 $(".list-remove").on("click",function(e){
612 if($(".selection").filter(":checked").length > 0){
613 return confirm(MSG_REMOVE_FROM_LIST);
615 alert(MSG_NO_ITEM_SELECTED);
619 $("#addToList").on("shown.bs.modal", function(e){
620 $("#barcodes").focus();
625 [% IF shelf AND op == 'edit_form' %]
626 $(document).ready(function(){
632 * This function checks if the adequate number of records are checked for merging
634 function MergeItems() {
635 var checkboxes = $("input:checkbox:checked");
636 if (checkboxes.length < 2) {
637 alert(_("At least two records must be selected for merging."));
640 $(checkboxes).each(function() {
641 params.push('biblionumber=' + $(this).val());
643 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
650 * This function checks all checkboxes if all are empty,
651 * or unchecks all if any already checked.
654 var checkboxes = document.getElementsByTagName('input');
655 var nbCheckbox = checkboxes.length;
656 var check = areAllChecked();
657 for(var i=0;i<nbCheckbox;i++){
658 if(checkboxes[i].getAttribute('type') == "checkbox" ){
659 checkboxes[i].checked = (check) ? 0 : 1;
664 * This function returns true if ALL checkboxes are checked
666 function areAllChecked(){
667 var checkboxes = document.getElementsByTagName('input');
668 var nbCheckbox = checkboxes.length;
669 for(var i=0;i<nbCheckbox;i++){
670 if(checkboxes[i].getAttribute('type') == "checkbox" ){
671 if(checkboxes[i].checked == 0){
679 function placeHold () {
680 var checkedItems = $(".selection:checked");
681 if ($(checkedItems).size() == 0) {
682 alert(MSG_NO_ITEM_SELECTED);
686 $(checkedItems).each(function() {
687 bibs += $(this).val() + "/";
689 $("#hold_form_biblios").val(bibs);
690 $("#hold_form").submit();
695 var checkboxes = $("#searchresults").find(":checkbox");
696 var vshelf = vShelfAdd(checkboxes);
697 if($("#addto").find("option:selected").attr("value") == "addtolist"){
698 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
700 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
703 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
705 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
708 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
710 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
714 if($("#addto").find("option:selected").attr("value") == "addtocart"){
715 addMultiple(checkboxes);
720 function AdjustRemark() {
721 var category = $("#category").val();
722 var perms = $("#allow_changes_from").val();
725 $("#anyone_remark").hide();
726 } else if( category==1 ) {
727 // If we move to Private (without shares), show Anyone remark
728 // Note: the number of shares is not tested real-time
729 [% IF !shelf.is_shared %]
730 $("#anyone_remark").show();
732 $("#anyone_remark").hide();
734 } else { // category==2
735 $("#anyone_remark").hide();
738 [% IF op == 'view' %]
741 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
744 $(document).ready(function() {
745 $("#sendlist").click(function(){
749 $("#deleteshelf").click(function(e){
750 if(confirm(_("Are you sure you want to delete this list?"))){
762 [% INCLUDE 'intranet-bottom.inc' %]