6 [% INCLUDE 'doc-head-open.inc' %]
9 Contents of [% shelf.shelfname | html %] › [% END %]
11 [% IF op == 'add_form' %]
12 Create new list › [% END %]
14 [% IF op == 'edit_form' %]
15 Edit list [% shelf.shelfname | html %] › [% END %]
18 [% INCLUDE 'doc-head-close.inc' %]
19 <style>textarea { width: 100%; }</style>
21 [% BLOCK list_permissions %]
23 <label for="allow_changes_from">Allow changes to contents from: </label>
24 <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
26 [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
28 [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
29 <option value="1" selected="selected">Owner only</option>
31 <option value="1">Owner only</option>
34 [% 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 %]
37   <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
42 <body id="lists_shelves" class="lists">
43 [% INCLUDE 'header.inc' %]
44 [% INCLUDE 'cat-search.inc' %]
46 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
49 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
54 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
58 <a href="#" aria-current="page">
64 [% IF shelf AND shelf.is_private %]
65 [% IF op == 'view' OR op == 'edit_form' %]
67 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0">Your lists</a>
71 <a href="#" aria-current="page">
77 [% ELSIF shelf AND shelf.is_public %]
80 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1">Public lists</a>
84 <a href="#" aria-current="page">
93 <a href="#" aria-current="page">
94 Contents of <em>[% shelf.shelfname | html %]</em>
99 [% IF op == 'add_form' %]
101 <a href="#" aria-current="page">
107 [% IF op == 'edit_form' %]
109 <a href="#" aria-current="page">
110 Edit list <em>[% shelf.shelfname | html %]</em>
117 <div class="main container-fluid">
119 <div class="col-sm-10 col-sm-push-1">
122 [% INCLUDE 'virtualshelves-toolbar.inc' %]
124 [% FOR m IN messages %]
125 <div class="dialog [% m.type | html %]">
127 [% CASE 'error_on_update' %]
128 <span>An error occurred when updating this list.</span>
129 [% CASE 'error_on_insert' %]
130 <span>An error occurred when creating this list.</span>
131 [% CASE 'error_on_delete' %]
132 <span>An error occurred when deleting this list.</span>
133 [% CASE 'error_on_add_biblio' %]
134 [% IF m.item_barcode %]
135 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
137 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
139 [% CASE 'success_on_update' %]
140 <span>List updated.</span>
141 [% CASE 'success_on_insert' %]
142 <span>List created.</span>
143 [% CASE 'success_on_delete' %]
144 <span>List deleted.</span>
145 [% CASE 'success_on_add_biblio' %]
146 [% IF m.item_barcode %]
147 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
149 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
151 [% CASE 'success_on_remove_biblios' %]
152 <span>The item has been removed from the list.</span>
153 [% CASE 'does_not_exist' %]
154 <span>This list does not exist.</span>
155 [% CASE 'item_does_not_exist' %]
156 [% IF m.item_barcode %]
157 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
159 <span>The record ([% m.bibnum | html %]) does not exist.</span>
161 [% CASE 'unauthorized_on_view' %]
162 <span>You do not have permission to view this list.</span>
163 [% CASE 'unauthorized_on_update' %]
164 <span>You do not have permission to update this list.</span>
165 [% CASE 'unauthorized_on_delete' %]
166 <span>You do not have permission to delete this list.</span>
167 [% CASE 'unauthorized_on_add_biblio' %]
168 <span>You do not have permission to add a record to this list.</span>
169 [% CASE 'no_biblio_removed' %]
170 <span>No record was removed.</span>
171 [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
172 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
173 [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %]
174 <span>List could not be created. (Do not use the database administrator account.)</span>
175 [% CASE 'DBIx::Class::Exception' %]
178 [% m.code | html %] [% m.msg | html %]
183 [% IF op == 'view' %]
186 <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3>
187 <div class="pages">[% pagination_bar | $raw %]</div>
188 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
189 <input type="hidden" name="op" value="remove_biblios" />
190 <input type="hidden" name="referer" value="view" />
191 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
193 [% IF direction == 'asc' %]
194 [% SET new_direction = 'desc' %]
196 [% SET direction = 'desc' %]
197 [% SET new_direction = 'asc' %]
201 <div id="searchheader" class="searchheader noprint">
202 <div id="selection_ops"><span class="checkall"></span> |
203 <span class="clearall"></span>
205 <span class="addto">| </span>
207 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
208 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
210 [% IF can_remove_biblios %]
211 <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>
213 [% 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 %]
218 <table id="searchresults" class="dataTable">
221 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
223 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
224 [% IF sortfield == 'title' %]
225 <th class="sorting_[% direction | html %]">
229 <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>
231 [% IF sortfield == 'author' %]
232 <th class="sorting_[% direction | html %]">
236 <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>
238 [% IF sortfield == 'dateadded' %]
239 <th class="sorting_[% direction | html %]">
243 <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>
245 [% IF sortfield == 'itemcallnumber' %]
246 <th class="sorting_[% direction | html %]">
250 <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>
254 [% FOREACH itemsloo IN itemsloop %]
258 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
261 [% UNLESS ( item_level_itypes ) %]<td>
262 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />[% END %][% itemsloo.description | html %]
265 [% IF ( itemsloo.XSLTBloc ) %]
266 [% itemsloo.XSLTBloc | $raw %]
268 [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
272 [% IF ( itemsloo.notforloan ) %]
273 <span class="noholdstext">No holds allowed</span>
275 [% IF ( itemsloo.ITEM_RESULTS.size ) %]
276 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
277 [% 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 %]
279 <span class="noholdstext">No holds allowed</span>
282 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
283 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
285 [% IF ( CAN_user_editcatalogue_edit_items ) %]
286 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
290 <td>[% itemsloo.author | html %]</td>
291 <td>[% itemsloo.dateadded | $KohaDates%]</td>
294 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
296 [% result.holdingbranch | html %]
297 [% IF ( result.location_intranet ) %]<span class="shelvingloc">[% result.location_intranet | html %]</span>[% END %]
298 [% IF ( result.itemcallnumber ) %]
299 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>]
306 [% END %]<!-- /itemsloop -->
308 <div class="pages">[% pagination_bar | $raw %]</div>
314 [% IF op == 'add_form' OR op == 'edit_form' %]
316 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
317 <fieldset class="rows">
319 [% IF op == 'add_form' %]
320 <legend>Create a new list</legend>
321 <input type="hidden" name="op" value="add" />
323 <legend>Edit list <em>[% shelf.shelfname | html %]</em></legend>
324 <input type="hidden" name="op" value="edit" />
326 <input type="hidden" name="referer" value="[% referer | html %]" />
327 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
330 <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" />
331 <span class="required">Required</span>
334 <span class="label">Owner: </span>
335 [% IF op == 'add_form' %]
336 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
339 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
341 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
345 <li><label for="sortfield" >Sort this list by: </label>
346 <select name="sortfield">
347 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
348 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
349 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
350 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
351 [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
353 <li><label for="public">Public: </label>
354 <select id="public" name="public" onchange="AdjustRemark()">
355 [% IF shelf.is_private %]
356 <option value="0" selected="selected">Private</option>
358 <option value="0">Private</option>
360 [% IF shelf.is_public %]
361 <option value="1" selected="selected">Public</option>
363 <option value="1">Public</option>
367 [% INCLUDE list_permissions %]
372 <fieldset class="action">
373 <input type="submit" value="Save" class="submit" />
374 [% IF referer == 'view' %]
375 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
378 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1" class="cancel">Cancel</a>
380 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0" class="cancel">Cancel</a>
388 [% IF op == 'list' %]
390 <div id="tabs" class="toptabs">
392 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
393 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
396 <div id="tab_content">
397 <table id="listresultst">
400 <th class="NoVisible">Type</th>
406 <th>Creation date</th>
407 <th>Modification date</th>
408 <th class="noExport">Actions</th>
410 <tr class="filters_row">
412 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
415 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
417 <select class="filter text_filter" id="searchsortby_filter">
418 <option value=""></option>
419 <option value="title">Title</option>
420 <option value="author">Author</option>
421 <option value="copyrightdate">Copyrightdate</option>
422 <option value="itemcallnumber">Call number</option>
423 <option value="dateadded">Date added</option>
437 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
438 <!-- Value will be set here by placeHold() -->
439 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
443 </div> <!-- /.col-sm-10.col-sm-push-2 -->
444 </div> <!-- /.row -->
446 [% IF ( can_add_biblios ) %]
448 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
449 <div class="modal-dialog" role="document">
450 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
451 <div class="modal-content">
452 <div class="modal-header">
453 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
454 <h4 class="modal-title" id="addToListLabel">Add items</h4>
456 <div class="modal-body">
457 <fieldset class="brief">
460 <label for="barcodes">Barcodes:</label>
461 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
462 <input type="hidden" name="op" value="add_biblio" />
463 <input type="hidden" name="referer" value="view" />
464 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
467 <label for="biblionumbers">Biblio numbers:</label>
468 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
469 <input type="hidden" name="op" value="add_biblio" />
470 <input type="hidden" name="referer" value="view" />
471 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
476 <div class="modal-footer">
477 <button type="submit" class="btn btn-default">Save</button>
478 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
486 [% MACRO jsinclude BLOCK %]
487 [% INCLUDE 'datatables.inc' %]
488 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
491 $( document ).ready(function() {
493 window.onafterprint = function () {
496 setTimeout('window.close()', 1000); // Hack for Chrome < 63
501 [% IF op == 'view' %]
502 [% Asset.js("lib/hc-sticky.js") | $raw %]
505 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
506 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
507 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
509 [% IF op == 'list' %]
510 $(document).ready(function(){
511 var public = [% public | html %];
513 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
514 "aaSorting": [[ 5, "asc" ]],
516 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
517 'fnServerData': function(sSource, aoData, fnCallback) {
523 'value': $("#searchshelfname_filter").val(),
526 'value': $("#searchowner_filter").val(),
529 'value': $("#searchsortby_filter").val(),
531 'name': 'template_path',
532 'value': 'virtualshelves/tables/shelves_results.tt',
534 'name': 'shelfname_sorton',
535 'value': 'vs.shelfname',
537 'name': 'is_shared_sorton',
538 'value': 'vs.public',
540 'name': 'owner_sorton',
543 'name': 'sortby_sorton',
544 'value': 'vs.sortfield',
546 'name': 'created_on_sorton',
547 'value': 'vs.created_on',
549 'name': 'modification_time_sorton',
550 'value': 'vs.lastmodified',
557 'success': function(json){
563 { 'mDataProp': 'dt_public' },
564 { 'mDataProp': 'dt_shelfname' },
565 { 'mDataProp': 'dt_count' },
566 { 'mDataProp': 'dt_is_shared' },
567 { 'mDataProp': 'dt_owner' },
568 { 'mDataProp': 'dt_sortby' },
569 { 'mDataProp': 'dt_created_on' },
570 { 'mDataProp': 'dt_modification_time' },
571 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
574 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
577 'sPaginationType': 'full_numbers',
580 "bSortCellsTop": true
583 dtListResults.fnAddFilters("filter", 750);
585 var tabs = $("#tabs").tabs({
591 activate: function(e, ui) {
592 var active = tabs.tabs("option", "active" );
595 dtListResults.fnDraw();
596 } else if ( active == 1 ) {
598 dtListResults.fnDraw();
602 $("body").on("click", ".deleteshelf", function(){
603 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
608 [% IF shelf AND op == 'view' %]
610 $(document).ready(function(){
611 Sticky = $("#searchheader");
613 stickTo: "#listform",
614 stickyClass: "floating"
616 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
617 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
618 $("#CheckAll").click(function(e){
620 $(".selection").each(function(){
621 $(this).prop("checked", true);
625 $("#CheckNone").click(function(e){
627 $(".selection").each(function(){
628 $(this).prop("checked", false);
631 $(".placehold").on("click",function(e){
635 $(".addtocart").show();
636 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
637 [% IF (Koha.Preference("intranetbookbag")) %]
638 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
640 [% IF Koha.Preference('virtualshelves') %]
641 [% IF add_to_some_private_shelves.count %]
642 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
643 [% SET number_of_private_shelves = 0 %]
644 [% FOREACH s IN add_to_some_private_shelves %]
645 [% IF shelfnumber != s.shelfnumber %]
646 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
647 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
648 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
651 param1 += "<\/optgroup>";
653 [% IF add_to_some_public_shelves.count %]
654 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
655 [% SET number_of_public_shelves = 0 %]
656 [% FOREACH s IN add_to_some_public_shelves %]
657 [% IF shelfnumber != s.shelfnumber %]
658 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
659 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
660 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
663 param1 += "<\/optgroup>";
665 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
666 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
668 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
670 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
671 $("span.addto").html(param1);
672 $("#cartsubmit").on("click",function(e){
676 $("#addto").change(function(){
679 $(".addto").find("input:submit").click(function(e){
683 $("#selection_ops").show();
684 $(".merge-items").on("click",function(e){
688 $("#listform").on("submit",function(e){
691 $(".list-remove").on("click",function(e){
692 if($(".selection").filter(":checked").length > 0){
693 return confirm(MSG_REMOVE_FROM_LIST);
695 alert(MSG_NO_ITEM_SELECTED);
699 $("#addToList").on("shown.bs.modal", function(e){
700 $("#barcodes").focus();
705 [% IF shelf AND op == 'edit_form' %]
706 $(document).ready(function(){
712 * This function checks if the adequate number of records are checked for merging
714 function MergeItems() {
715 var checkboxes = $("input:checkbox:checked");
716 if (checkboxes.length < 2) {
717 alert(_("At least two records must be selected for merging."));
720 $(checkboxes).each(function() {
721 params.push('biblionumber=' + $(this).val());
723 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
730 * This function checks all checkboxes if all are empty,
731 * or unchecks all if any already checked.
734 var checkboxes = document.getElementsByTagName('input');
735 var nbCheckbox = checkboxes.length;
736 var check = areAllChecked();
737 for(var i=0;i<nbCheckbox;i++){
738 if(checkboxes[i].getAttribute('type') == "checkbox" ){
739 checkboxes[i].checked = (check) ? 0 : 1;
744 * This function returns true if ALL checkboxes are checked
746 function areAllChecked(){
747 var checkboxes = document.getElementsByTagName('input');
748 var nbCheckbox = checkboxes.length;
749 for(var i=0;i<nbCheckbox;i++){
750 if(checkboxes[i].getAttribute('type') == "checkbox" ){
751 if(checkboxes[i].checked == 0){
759 function placeHold () {
760 var checkedItems = $(".selection:checked");
761 if ($(checkedItems).size() == 0) {
762 alert(MSG_NO_ITEM_SELECTED);
766 $(checkedItems).each(function() {
767 bibs += $(this).val() + "/";
769 $("#hold_form_biblios").val(bibs);
770 $("#hold_form").submit();
775 var checkboxes = $("#searchresults").find(":checkbox");
776 var vshelf = vShelfAdd(checkboxes);
777 if($("#addto").find("option:selected").attr("value") == "addtolist"){
778 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
780 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
783 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
785 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
788 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
790 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
794 if($("#addto").find("option:selected").attr("value") == "addtocart"){
795 addMultiple(checkboxes);
800 function AdjustRemark() {
801 var public = $("#public").val();
802 var perms = $("#allow_changes_from").val();
805 $("#anyone_remark").hide();
806 } else if( public==0 ) {
807 // If we move to Private (without shares), show Anyone remark
808 // Note: the number of shares is not tested real-time
809 [% IF !shelf.is_shared %]
810 $("#anyone_remark").show();
812 $("#anyone_remark").hide();
814 } else { // public==1
815 $("#anyone_remark").hide();
818 [% IF op == 'view' %]
821 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
824 $(document).ready(function() {
825 $("#sendlist").click(function(){
829 $("#deleteshelf").click(function(e){
830 if(confirm(_("Are you sure you want to delete this list?"))){
842 [% INCLUDE 'intranet-bottom.inc' %]