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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
41 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
46 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
50 <a href="#" aria-current="page">
56 [% IF shelf AND shelf.is_private %]
57 [% IF op == 'view' OR op == 'edit_form' %]
59 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE | uri %]">Your lists</a>
63 <a href="#" aria-current="page">
69 [% ELSIF shelf AND shelf.is_public %]
72 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC | uri %]">Public lists</a>
76 <a href="#" aria-current="page">
85 <a href="#" aria-current="page">
86 Contents of <em>[% shelf.shelfname | html %]</em>
91 [% IF op == 'add_form' %]
93 <a href="#" aria-current="page">
99 [% IF op == 'edit_form' %]
101 <a href="#" aria-current="page">
102 Edit list <em>[% shelf.shelfname | html %]</em>
109 <div class="main container-fluid">
111 <div class="col-sm-10 col-sm-push-1">
114 [% INCLUDE 'virtualshelves-toolbar.inc' %]
116 [% FOR m IN messages %]
117 <div class="dialog [% m.type | html %]">
119 [% CASE 'error_on_update' %]
120 <span>An error occurred when updating this list.</span>
121 [% CASE 'error_on_insert' %]
122 <span>An error occurred when creating this list.</span>
123 [% CASE 'error_on_delete' %]
124 <span>An error occurred when deleting this list.</span>
125 [% CASE 'error_on_add_biblio' %]
126 [% IF m.item_barcode %]
127 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
129 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
131 [% CASE 'success_on_update' %]
132 <span>List updated.</span>
133 [% CASE 'success_on_insert' %]
134 <span>List created.</span>
135 [% CASE 'success_on_delete' %]
136 <span>List deleted.</span>
137 [% CASE 'success_on_add_biblio' %]
138 [% IF m.item_barcode %]
139 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
141 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
143 [% CASE 'success_on_remove_biblios' %]
144 <span>The item has been removed from the list.</span>
145 [% CASE 'does_not_exist' %]
146 <span>This list does not exist.</span>
147 [% CASE 'item_does_not_exist' %]
148 [% IF m.item_barcode %]
149 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
151 <span>The record ([% m.bibnum | html %]) does not exist.</span>
153 [% CASE 'unauthorized_on_view' %]
154 <span>You do not have permission to view this list.</span>
155 [% CASE 'unauthorized_on_update' %]
156 <span>You do not have permission to update this list.</span>
157 [% CASE 'unauthorized_on_delete' %]
158 <span>You do not have permission to delete this list.</span>
159 [% CASE 'unauthorized_on_add_biblio' %]
160 <span>You do not have permission to add a record to this list.</span>
161 [% CASE 'no_biblio_removed' %]
162 <span>No record was removed.</span>
163 [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
164 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
165 [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %]
166 <span>List could not be created. (Do not use the database administrator account.)</span>
167 [% CASE 'DBIx::Class::Exception' %]
170 [% m.code | html %] [% m.msg | html %]
175 [% IF op == 'view' %]
178 <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3>
179 <div class="pages">[% pagination_bar | $raw %]</div>
180 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
181 <input type="hidden" name="op" value="remove_biblios" />
182 <input type="hidden" name="referer" value="view" />
183 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
185 [% IF direction == 'asc' %]
186 [% SET new_direction = 'desc' %]
188 [% SET direction = 'desc' %]
189 [% SET new_direction = 'asc' %]
193 <div id="searchheader" class="searchheader noprint">
194 <div id="selection_ops"><span class="checkall"></span> |
195 <span class="clearall"></span>
197 <span class="addto">| </span>
199 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
200 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
202 [% IF can_remove_biblios %]
203 <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>
205 [% 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 %]
210 <table id="searchresults" class="dataTable">
213 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
215 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
216 [% IF sortfield == 'title' %]
217 <th class="sorting_[% direction | html %]">
221 <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>
223 [% IF sortfield == 'author' %]
224 <th class="sorting_[% direction | html %]">
228 <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>
230 [% IF sortfield == 'dateadded' %]
231 <th class="sorting_[% direction | html %]">
235 <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>
237 [% IF sortfield == 'itemcallnumber' %]
238 <th class="sorting_[% direction | html %]">
242 <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>
246 [% FOREACH itemsloo IN itemsloop %]
250 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
253 [% UNLESS ( item_level_itypes ) %]<td>
254 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />[% END %][% itemsloo.description | html %]
257 [% IF ( itemsloo.XSLTBloc ) %]
258 [% itemsloo.XSLTBloc | $raw %]
260 [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
264 [% IF ( itemsloo.notforloan ) %]
265 <span class="noholdstext">No holds allowed</span>
267 [% IF ( itemsloo.ITEM_RESULTS.size ) %]
268 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
269 [% 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 %]
271 <span class="noholdstext">No holds allowed</span>
274 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
275 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
277 [% IF ( CAN_user_editcatalogue_edit_items ) %]
278 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
282 <td>[% itemsloo.author | html %]</td>
283 <td>[% itemsloo.dateadded | $KohaDates%]</td>
286 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
288 [% result.holdingbranch | html %]
289 [% IF ( result.location_intranet ) %]<span class="shelvingloc">[% result.location_intranet | html %]</span>[% END %]
290 [% IF ( result.itemcallnumber ) %]
291 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>]
298 [% END %]<!-- /itemsloop -->
300 <div class="pages">[% pagination_bar | $raw %]</div>
306 [% IF op == 'add_form' OR op == 'edit_form' %]
308 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
309 <fieldset class="rows">
311 [% IF op == 'add_form' %]
312 <legend>Create a new list</legend>
313 <input type="hidden" name="op" value="add" />
315 <legend>Edit list <em>[% shelf.shelfname | html %]</em></legend>
316 <input type="hidden" name="op" value="edit" />
318 <input type="hidden" name="referer" value="[% referer | html %]" />
319 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
322 <label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelf.shelfname | html %]" required="required" class="focus required" />
323 <span class="required">Required</span>
326 <span class="label">Owner: </span>
327 [% IF op == 'add_form' %]
328 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
331 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
333 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
337 <li><label for="sortfield" >Sort this list by: </label>
338 <select name="sortfield">
339 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
340 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
341 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
342 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
343 [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
345 <li><label for="category">Category: </label>
346 <select id="category" name="category" onchange="AdjustRemark()">
347 [% IF shelf.is_private %]
348 <option value="1" selected="selected">Private</option>
350 <option value="1">Private</option>
352 [% IF shelf.is_public %]
353 <option value="2" selected="selected">Public</option>
355 <option value="2">Public</option>
359 [% INCLUDE list_permissions %]
364 <fieldset class="action">
365 <input type="submit" value="Save" class="submit" />
366 [% IF referer == 'view' %]
367 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
369 [% IF category == PUBLIC %]
370 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC | uri %]" class="cancel">Cancel</a>
372 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
380 [% IF op == 'list' %]
382 <div id="tabs" class="toptabs">
384 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
385 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
388 <div id="tab_content">
389 <table id="listresultst">
392 <th class="NoVisible">Type</th>
398 <th>Creation date</th>
399 <th>Modification date</th>
400 <th class="noExport">Actions</th>
402 <tr class="filters_row">
404 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
407 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
409 <select class="filter text_filter" id="searchsortby_filter">
410 <option value=""></option>
411 <option value="title">Title</option>
412 <option value="author">Author</option>
413 <option value="copyrightdate">Copyrightdate</option>
414 <option value="itemcallnumber">Call number</option>
415 <option value="dateadded">Date added</option>
429 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
430 <!-- Value will be set here by placeHold() -->
431 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
435 </div> <!-- /.col-sm-10.col-sm-push-2 -->
436 </div> <!-- /.row -->
438 [% IF ( can_add_biblios ) %]
440 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
441 <div class="modal-dialog" role="document">
442 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
443 <div class="modal-content">
444 <div class="modal-header">
445 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
446 <h4 class="modal-title" id="addToListLabel">Add items</h4>
448 <div class="modal-body">
449 <fieldset class="brief">
452 <label for="barcodes">Barcodes:</label>
453 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
454 <input type="hidden" name="op" value="add_biblio" />
455 <input type="hidden" name="referer" value="view" />
456 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
459 <label for="biblionumbers">Biblio numbers:</label>
460 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
461 <input type="hidden" name="op" value="add_biblio" />
462 <input type="hidden" name="referer" value="view" />
463 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
468 <div class="modal-footer">
469 <button type="submit" class="btn btn-default">Save</button>
470 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
478 [% MACRO jsinclude BLOCK %]
479 [% INCLUDE 'datatables.inc' %]
480 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
483 $( document ).ready(function() {
485 setTimeout('window.close()', 1);
490 [% IF op == 'view' %]
491 [% Asset.js("lib/hc-sticky.js") | $raw %]
494 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
495 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
496 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
498 [% IF op == 'list' %]
499 $(document).ready(function(){
500 [% IF category == PUBLIC %]
501 var type = [% PUBLIC | html %];
503 var type = [% PRIVATE | html %];
506 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
507 "aaSorting": [[ 5, "asc" ]],
509 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
510 'fnServerData': function(sSource, aoData, fnCallback) {
516 'value': $("#searchshelfname_filter").val(),
519 'value': $("#searchowner_filter").val(),
522 'value': $("#searchsortby_filter").val(),
524 'name': 'template_path',
525 'value': 'virtualshelves/tables/shelves_results.tt',
527 'name': 'shelfname_sorton',
528 'value': 'vs.shelfname',
530 'name': 'is_shared_sorton',
531 'value': 'vs.category',
533 'name': 'owner_sorton',
536 'name': 'sortby_sorton',
537 'value': 'vs.sortfield',
539 'name': 'created_on_sorton',
540 'value': 'vs.created_on',
542 'name': 'modification_time_sorton',
543 'value': 'vs.lastmodified',
550 'success': function(json){
556 { 'mDataProp': 'dt_type' },
557 { 'mDataProp': 'dt_shelfname' },
558 { 'mDataProp': 'dt_count' },
559 { 'mDataProp': 'dt_is_shared' },
560 { 'mDataProp': 'dt_owner' },
561 { 'mDataProp': 'dt_sortby' },
562 { 'mDataProp': 'dt_created_on' },
563 { 'mDataProp': 'dt_modification_time' },
564 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
567 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
570 'sPaginationType': 'full_numbers',
573 "bSortCellsTop": true
576 dtListResults.fnAddFilters("filter", 750);
578 var tabs = $("#tabs").tabs({
579 [% IF category == PUBLIC %]
584 activate: function(e, ui) {
585 var active = tabs.tabs("option", "active" );
587 type = [% PRIVATE | html %];
588 dtListResults.fnDraw();
589 } else if ( active == 1 ) {
590 type = [% PUBLIC | html %];
591 dtListResults.fnDraw();
595 $("body").on("click", ".deleteshelf", function(){
596 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
601 [% IF shelf AND op == 'view' %]
603 $(document).ready(function(){
604 Sticky = $("#searchheader");
606 stickTo: "#listform",
607 stickyClass: "floating"
609 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
610 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
611 $("#CheckAll").click(function(e){
613 $(".selection").each(function(){
614 $(this).prop("checked", true);
618 $("#CheckNone").click(function(e){
620 $(".selection").each(function(){
621 $(this).prop("checked", false);
624 $(".placehold").on("click",function(e){
628 $(".addtocart").show();
629 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
630 [% IF (Koha.Preference("intranetbookbag")) %]
631 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
633 [% IF Koha.Preference('virtualshelves') %]
634 [% IF add_to_some_private_shelves.count %]
635 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
636 [% SET number_of_private_shelves = 0 %]
637 [% FOREACH s IN add_to_some_private_shelves %]
638 [% IF shelfnumber != s.shelfnumber %]
639 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
640 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
641 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
644 param1 += "<\/optgroup>";
646 [% IF add_to_some_public_shelves.count %]
647 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
648 [% SET number_of_public_shelves = 0 %]
649 [% FOREACH s IN add_to_some_public_shelves %]
650 [% IF shelfnumber != s.shelfnumber %]
651 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
652 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
653 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
656 param1 += "<\/optgroup>";
658 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
659 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
661 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
663 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
664 $("span.addto").html(param1);
665 $("#cartsubmit").on("click",function(e){
669 $("#addto").change(function(){
672 $(".addto").find("input:submit").click(function(e){
676 $("#selection_ops").show();
677 $(".merge-items").on("click",function(e){
681 $("#listform").on("submit",function(e){
684 $(".list-remove").on("click",function(e){
685 if($(".selection").filter(":checked").length > 0){
686 return confirm(MSG_REMOVE_FROM_LIST);
688 alert(MSG_NO_ITEM_SELECTED);
692 $("#addToList").on("shown.bs.modal", function(e){
693 $("#barcodes").focus();
698 [% IF shelf AND op == 'edit_form' %]
699 $(document).ready(function(){
705 * This function checks if the adequate number of records are checked for merging
707 function MergeItems() {
708 var checkboxes = $("input:checkbox:checked");
709 if (checkboxes.length < 2) {
710 alert(_("At least two records must be selected for merging."));
713 $(checkboxes).each(function() {
714 params.push('biblionumber=' + $(this).val());
716 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
723 * This function checks all checkboxes if all are empty,
724 * or unchecks all if any already checked.
727 var checkboxes = document.getElementsByTagName('input');
728 var nbCheckbox = checkboxes.length;
729 var check = areAllChecked();
730 for(var i=0;i<nbCheckbox;i++){
731 if(checkboxes[i].getAttribute('type') == "checkbox" ){
732 checkboxes[i].checked = (check) ? 0 : 1;
737 * This function returns true if ALL checkboxes are checked
739 function areAllChecked(){
740 var checkboxes = document.getElementsByTagName('input');
741 var nbCheckbox = checkboxes.length;
742 for(var i=0;i<nbCheckbox;i++){
743 if(checkboxes[i].getAttribute('type') == "checkbox" ){
744 if(checkboxes[i].checked == 0){
752 function placeHold () {
753 var checkedItems = $(".selection:checked");
754 if ($(checkedItems).size() == 0) {
755 alert(MSG_NO_ITEM_SELECTED);
759 $(checkedItems).each(function() {
760 bibs += $(this).val() + "/";
762 $("#hold_form_biblios").val(bibs);
763 $("#hold_form").submit();
768 var checkboxes = $("#searchresults").find(":checkbox");
769 var vshelf = vShelfAdd(checkboxes);
770 if($("#addto").find("option:selected").attr("value") == "addtolist"){
771 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
773 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
776 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
778 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
781 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
783 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
787 if($("#addto").find("option:selected").attr("value") == "addtocart"){
788 addMultiple(checkboxes);
793 function AdjustRemark() {
794 var category = $("#category").val();
795 var perms = $("#allow_changes_from").val();
798 $("#anyone_remark").hide();
799 } else if( category==1 ) {
800 // If we move to Private (without shares), show Anyone remark
801 // Note: the number of shares is not tested real-time
802 [% IF !shelf.is_shared %]
803 $("#anyone_remark").show();
805 $("#anyone_remark").hide();
807 } else { // category==2
808 $("#anyone_remark").hide();
811 [% IF op == 'view' %]
814 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
817 $(document).ready(function() {
818 $("#sendlist").click(function(){
822 $("#deleteshelf").click(function(e){
823 if(confirm(_("Are you sure you want to delete this list?"))){
835 [% INCLUDE 'intranet-bottom.inc' %]