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 <style>textarea { width: 100%; }</style>
13 [% BLOCK list_permissions %]
15 <label for="allow_changes_from">Allow changes to contents from: </label>
16 <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
18 [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
20 [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
21 <option value="1" selected="selected">Owner only</option>
23 <option value="1">Owner only</option>
26 [% 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 %]
29   <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
34 <body id="lists_shelves" class="lists">
35 [% INCLUDE 'header.inc' %]
36 [% INCLUDE 'cat-search.inc' %]
38 <div id="breadcrumbs">
39 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
41 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
45 [% IF shelf AND shelf.is_private %] ›
46 [% IF op == 'view' OR op == 'edit_form' %]
47 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE | uri %]">Your lists</a>
51 [% ELSIF shelf AND shelf.is_public %] ›
53 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC | uri %]">Public lists</a>
59 [% 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>
61 <div class="main container-fluid">
63 <div class="col-sm-10 col-sm-push-1">
66 [% INCLUDE 'virtualshelves-toolbar.inc' %]
68 [% FOR m IN messages %]
69 <div class="dialog [% m.type | html %]">
71 [% CASE 'error_on_update' %]
72 <span>An error occurred when updating this list.</span>
73 [% CASE 'error_on_insert' %]
74 <span>An error occurred when creating this list.</span>
75 [% CASE 'error_on_delete' %]
76 <span>An error occurred when deleting this list.</span>
77 [% CASE 'error_on_add_biblio' %]
78 [% IF m.item_barcode %]
79 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
81 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
83 [% CASE 'success_on_update' %]
84 <span>List updated.</span>
85 [% CASE 'success_on_insert' %]
86 <span>List created.</span>
87 [% CASE 'success_on_delete' %]
88 <span>List deleted.</span>
89 [% CASE 'success_on_add_biblio' %]
90 [% IF m.item_barcode %]
91 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
93 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
95 [% CASE 'success_on_remove_biblios' %]
96 <span>The item has been removed from the list.</span>
97 [% CASE 'does_not_exist' %]
98 <span>This list does not exist.</span>
99 [% CASE 'item_does_not_exist' %]
100 [% IF m.item_barcode %]
101 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
103 <span>The record ([% m.bibnum | html %]) does not exist.</span>
105 [% CASE 'unauthorized_on_view' %]
106 <span>You do not have permission to view this list.</span>
107 [% CASE 'unauthorized_on_update' %]
108 <span>You do not have permission to update this list.</span>
109 [% CASE 'unauthorized_on_delete' %]
110 <span>You do not have permission to delete this list.</span>
111 [% CASE 'unauthorized_on_add_biblio' %]
112 <span>You do not have permission to add a record to this list.</span>
113 [% CASE 'no_biblio_removed' %]
114 <span>No record was removed.</span>
115 [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
116 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
117 [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %]
118 <span>List could not be created. (Do not use the database administrator account.)</span>
119 [% CASE 'DBIx::Class::Exception' %]
122 [% m.code | html %] [% m.msg | html %]
127 [% IF op == 'view' %]
130 <h3>Contents of <i>[% shelf.shelfname | html %]</i></h3>
131 <div class="pages">[% pagination_bar | $raw %]</div>
132 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
133 <input type="hidden" name="op" value="remove_biblios" />
134 <input type="hidden" name="referer" value="view" />
135 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
137 [% IF direction == 'asc' %]
138 [% SET new_direction = 'desc' %]
140 [% SET direction = 'desc' %]
141 [% SET new_direction = 'asc' %]
145 <div id="searchheader" class="noprint">
146 <div id="selection_ops"><span class="checkall"></span> |
147 <span class="clearall"></span>
149 <span class="addto">| </span>
151 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
152 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
154 [% IF can_remove_biblios %]
155 <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>
157 [% 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 %]
162 <table id="searchresults">
164 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
166 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
168 <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>
169 [% IF sortfield == 'title' %]
170 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
172 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
176 <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>
177 [% IF sortfield == 'author' %]
178 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
180 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
184 <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>
185 [% IF sortfield == 'dateadded' %]
186 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
188 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
192 <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>
193 [% IF sortfield == 'itemcallnumber' %]
194 <img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
196 <img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
200 [% FOREACH itemsloo IN itemsloop %]
204 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
207 [% UNLESS ( item_level_itypes ) %]<td>
208 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />[% END %][% itemsloo.description | html %]
211 [% IF ( itemsloo.XSLTBloc ) %]
212 [% itemsloo.XSLTBloc | $raw %]
214 [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %]
215 [% itemsloo.title | html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl | html %][% END %]</a>
218 [% IF ( itemsloo.notforloan ) %]
219 <span class="noholdstext">No holds allowed</span>
221 [% IF ( itemsloo.ITEM_RESULTS.size ) %]
222 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
223 [% 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 %]
225 <span class="noholdstext">No holds allowed</span>
228 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
229 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
231 [% IF ( CAN_user_editcatalogue_edit_items ) %]
232 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
236 <td>[% itemsloo.author | html %]</td>
237 <td>[% itemsloo.dateadded | $KohaDates%]</td>
240 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
242 [% result.holdingbranch | html %]
243 [% IF ( result.location_intranet ) %]<span class="shelvingloc">[% result.location_intranet | html %]</span>[% END %]
244 [% IF ( result.itemcallnumber ) %]
245 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>]
252 [% END %]<!-- /itemsloop -->
254 <div class="pages">[% pagination_bar | $raw %]</div>
260 [% IF op == 'add_form' OR op == 'edit_form' %]
262 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
263 <fieldset class="rows">
265 [% IF op == 'add_form' %]
266 <legend>Create a new list</legend>
267 <input type="hidden" name="op" value="add" />
269 <legend>Edit list <i>[% shelf.shelfname | html %]</i></legend>
270 <input type="hidden" name="op" value="edit" />
272 <input type="hidden" name="referer" value="[% referer | html %]" />
273 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
276 <label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelf.shelfname | html %]" required="required" class="required" />
277 <span class="required">Required</span>
280 <span class="label">Owner: </span>
281 [% IF op == 'add_form' %]
282 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
285 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
287 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
291 <li><label for="sortfield" >Sort this list by: </label>
292 <select name="sortfield">
293 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
294 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
295 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
296 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
297 [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
299 <li><label for="category">Category: </label>
300 <select id="category" name="category" onchange="AdjustRemark()">
301 [% IF shelf.is_private %]
302 <option value="1" selected="selected">Private</option>
304 <option value="1">Private</option>
306 [% IF shelf.is_public %]
307 <option value="2" selected="selected">Public</option>
309 <option value="2">Public</option>
313 [% INCLUDE list_permissions %]
318 <fieldset class="action">
319 <input type="submit" value="Save" class="submit" />
320 [% IF referer == 'view' %]
321 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
323 [% IF category == PUBLIC %]
324 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC | uri %]" class="cancel">Cancel</a>
326 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
334 [% IF op == 'list' %]
336 <div id="tabs" class="toptabs">
338 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
339 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
342 <div id="tab_content">
343 <table id="listresultst">
346 <th class="NoVisible">Type</th>
352 <th>Creation date</th>
353 <th>Modification date</th>
356 <tr class="filters_row">
358 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
361 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
363 <select class="filter text_filter" id="searchsortby_filter">
364 <option value=""></option>
365 <option value="title">Title</option>
366 <option value="author">Author</option>
367 <option value="copyrightdate">Copyrightdate</option>
368 <option value="itemcallnumber">Call number</option>
369 <option value="dateadded">Date added</option>
383 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
384 <!-- Value will be set here by placeHold() -->
385 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
386 <input type="hidden" name="multi_hold" value="1"/>
390 </div> <!-- /.col-sm-10.col-sm-push-2 -->
391 </div> <!-- /.row -->
393 [% IF ( can_add_biblios ) %]
395 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
396 <div class="modal-dialog" role="document">
397 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
398 <div class="modal-content">
399 <div class="modal-header">
400 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
401 <h4 class="modal-title" id="addToListLabel">Add items</h4>
403 <div class="modal-body">
404 <fieldset class="brief">
407 <label for="barcodes">Barcodes:</label>
408 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
409 <input type="hidden" name="op" value="add_biblio" />
410 <input type="hidden" name="referer" value="view" />
411 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
414 <label for="biblionumbers">Biblio numbers:</label>
415 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
416 <input type="hidden" name="op" value="add_biblio" />
417 <input type="hidden" name="referer" value="view" />
418 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
423 <div class="modal-footer">
424 <button type="submit" class="btn btn-default">Save</button>
425 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
433 [% MACRO jsinclude BLOCK %]
434 [% INCLUDE 'datatables.inc' %]
435 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
438 $( document ).ready(function() {
440 setTimeout('window.close()', 1);
445 [% IF op == 'view' %]
446 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
447 [% Asset.js("lib/hc-sticky.js") | $raw %]
450 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
451 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
452 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
454 [% IF op == 'list' %]
455 $(document).ready(function(){
456 [% IF category == PUBLIC %]
457 var type = [% PUBLIC | html %];
459 var type = [% PRIVATE | html %];
462 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
463 "aaSorting": [[ 5, "asc" ]],
465 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
466 'fnServerData': function(sSource, aoData, fnCallback) {
472 'value': $("#searchshelfname_filter").val(),
475 'value': $("#searchowner_filter").val(),
478 'value': $("#searchsortby_filter").val(),
480 'name': 'template_path',
481 'value': 'virtualshelves/tables/shelves_results.tt',
488 'success': function(json){
494 { 'mDataProp': 'dt_type' },
495 { 'mDataProp': 'dt_shelfname' },
496 { 'mDataProp': 'dt_count' },
497 { 'mDataProp': 'dt_is_shared' },
498 { 'mDataProp': 'dt_owner' },
499 { 'mDataProp': 'dt_sortby' },
500 { 'mDataProp': 'dt_created_on' },
501 { 'mDataProp': 'dt_modification_time' },
502 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
505 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
508 'sPaginationType': 'full_numbers',
511 "bSortCellsTop": true
514 dtListResults.fnAddFilters("filter", 750);
516 var tabs = $("#tabs").tabs({
517 [% IF category == PUBLIC %]
522 activate: function(e, ui) {
523 var active = tabs.tabs("option", "active" );
525 type = [% PRIVATE | html %];
526 dtListResults.fnDraw();
527 } else if ( active == 1 ) {
528 type = [% PUBLIC | html %];
529 dtListResults.fnDraw();
533 $("body").on("click", ".deleteshelf", function(){
534 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
539 [% IF shelf AND op == 'view' %]
541 $(document).ready(function(){
542 Sticky = $("#searchheader");
544 stickTo: "#listform",
545 stickyClass: "floating"
547 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
548 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
549 $("#CheckAll").click(function(){
550 $(".checkboxed").checkCheckboxes();
553 $("#CheckNone").click(function(){
554 $(".checkboxed").unCheckCheckboxes();
557 $(".placehold").on("click",function(e){
561 $(".addtocart").show();
562 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
563 [% IF ( intranetbookbag ) %]
564 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
566 [% IF Koha.Preference('virtualshelves') %]
567 [% IF add_to_some_private_shelves.count %]
568 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
569 [% SET number_of_private_shelves = 0 %]
570 [% FOREACH s IN add_to_some_private_shelves %]
571 [% IF shelfnumber != s.shelfnumber %]
572 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
573 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
574 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
577 param1 += "<\/optgroup>";
579 [% IF add_to_some_public_shelves.count %]
580 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
581 [% SET number_of_public_shelves = 0 %]
582 [% FOREACH s IN add_to_some_public_shelves %]
583 [% IF shelfnumber != s.shelfnumber %]
584 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
585 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
586 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
589 param1 += "<\/optgroup>";
591 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
592 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
594 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
596 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
597 $("span.addto").html(param1);
598 $("#cartsubmit").on("click",function(e){
602 $("#addto").change(function(){
605 $(".addto").find("input:submit").click(function(e){
609 $("#selection_ops").show();
610 $(".merge-items").on("click",function(e){
614 $("#listform").on("submit",function(e){
617 $(".list-remove").on("click",function(e){
618 if($(".selection").filter(":checked").length > 0){
619 return confirm(MSG_REMOVE_FROM_LIST);
621 alert(MSG_NO_ITEM_SELECTED);
625 $("#addToList").on("shown.bs.modal", function(e){
626 $("#barcodes").focus();
631 [% IF shelf AND op == 'edit_form' %]
632 $(document).ready(function(){
638 * This function checks if the adequate number of records are checked for merging
640 function MergeItems() {
641 var checkboxes = $("input:checkbox:checked");
642 if (checkboxes.length < 2) {
643 alert(_("At least two records must be selected for merging."));
646 $(checkboxes).each(function() {
647 params.push('biblionumber=' + $(this).val());
649 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
656 * This function checks all checkboxes if all are empty,
657 * or unchecks all if any already checked.
660 var checkboxes = document.getElementsByTagName('input');
661 var nbCheckbox = checkboxes.length;
662 var check = areAllChecked();
663 for(var i=0;i<nbCheckbox;i++){
664 if(checkboxes[i].getAttribute('type') == "checkbox" ){
665 checkboxes[i].checked = (check) ? 0 : 1;
670 * This function returns true if ALL checkboxes are checked
672 function areAllChecked(){
673 var checkboxes = document.getElementsByTagName('input');
674 var nbCheckbox = checkboxes.length;
675 for(var i=0;i<nbCheckbox;i++){
676 if(checkboxes[i].getAttribute('type') == "checkbox" ){
677 if(checkboxes[i].checked == 0){
685 function placeHold () {
686 var checkedItems = $(".selection:checked");
687 if ($(checkedItems).size() == 0) {
688 alert(MSG_NO_ITEM_SELECTED);
692 $(checkedItems).each(function() {
693 bibs += $(this).val() + "/";
695 $("#hold_form_biblios").val(bibs);
696 $("#hold_form").submit();
701 var checkboxes = $("#searchresults").find(":checkbox");
702 var vshelf = vShelfAdd(checkboxes);
703 if($("#addto").find("option:selected").attr("value") == "addtolist"){
704 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
706 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
709 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
711 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
714 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
716 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
720 if($("#addto").find("option:selected").attr("value") == "addtocart"){
721 addMultiple(checkboxes);
726 function AdjustRemark() {
727 var category = $("#category").val();
728 var perms = $("#allow_changes_from").val();
731 $("#anyone_remark").hide();
732 } else if( category==1 ) {
733 // If we move to Private (without shares), show Anyone remark
734 // Note: the number of shares is not tested real-time
735 [% IF !shelf.is_shared %]
736 $("#anyone_remark").show();
738 $("#anyone_remark").hide();
740 } else { // category==2
741 $("#anyone_remark").hide();
744 [% IF op == 'view' %]
747 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
750 $(document).ready(function() {
751 $("#sendlist").click(function(){
755 $("#deleteshelf").click(function(e){
756 if(confirm(_("Are you sure you want to delete this list?"))){
768 [% INCLUDE 'intranet-bottom.inc' %]