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 %]
36 [% IF shelf.allow_change_from_staff %]<option value="3" selected="selected">Staff only</option>[% ELSE %]<option value="3">Staff only</option>[% END %]
39   <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
40   <span id="staff_remark" style="display:none;color:red;">The Staff only permission has no actual effect while this list is strictly private.</span>
45 <body id="lists_shelves" class="lists">
46 [% INCLUDE 'header.inc' %]
47 [% INCLUDE 'cat-search.inc' %]
49 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
52 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
57 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
61 <a href="#" aria-current="page">
67 [% IF shelf AND shelf.is_private %]
68 [% IF op == 'view' OR op == 'edit_form' %]
70 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0">Your lists</a>
74 <a href="#" aria-current="page">
80 [% ELSIF shelf AND shelf.is_public %]
83 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1">Public lists</a>
87 <a href="#" aria-current="page">
96 <a href="#" aria-current="page">
97 Contents of <em>[% shelf.shelfname | html %]</em>
102 [% IF op == 'add_form' %]
104 <a href="#" aria-current="page">
110 [% IF op == 'edit_form' %]
112 <a href="#" aria-current="page">
113 Edit list <em>[% shelf.shelfname | html %]</em>
120 <div class="main container-fluid">
122 <div class="col-sm-10 col-sm-push-1">
125 [% INCLUDE 'virtualshelves-toolbar.inc' %]
127 [% FOR m IN messages %]
128 <div class="dialog [% m.type | html %]">
130 [% CASE 'error_on_update' %]
131 <span>An error occurred when updating this list.</span>
132 [% CASE 'error_on_insert' %]
133 <span>An error occurred when creating this list.</span>
134 [% CASE 'error_on_delete' %]
135 <span>An error occurred when deleting this list.</span>
136 [% CASE 'error_on_add_biblio' %]
137 [% IF m.item_barcode %]
138 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
140 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
142 [% CASE 'success_on_update' %]
143 <span>List updated.</span>
144 [% CASE 'success_on_insert' %]
145 <span>List created.</span>
146 [% CASE 'success_on_delete' %]
147 <span>List deleted.</span>
148 [% CASE 'success_on_add_biblio' %]
149 [% IF m.item_barcode %]
150 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
152 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
154 [% CASE 'success_on_remove_biblios' %]
155 <span>The item has been removed from the list.</span>
156 [% CASE 'does_not_exist' %]
157 <span>This list does not exist.</span>
158 [% CASE 'item_does_not_exist' %]
159 [% IF m.item_barcode %]
160 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
162 <span>The record ([% m.bibnum | html %]) does not exist.</span>
164 [% CASE 'unauthorized_on_view' %]
165 <span>You do not have permission to view this list.</span>
166 [% CASE 'unauthorized_on_update' %]
167 <span>You do not have permission to update this list.</span>
168 [% CASE 'unauthorized_on_delete' %]
169 <span>You do not have permission to delete this list.</span>
170 [% CASE 'unauthorized_on_add_biblio' %]
171 <span>You do not have permission to add a record to this list.</span>
172 [% CASE 'no_biblio_removed' %]
173 <span>No record was removed.</span>
174 [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
175 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
176 [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %]
177 <span>List could not be created. (Do not use the database administrator account.)</span>
178 [% CASE 'DBIx::Class::Exception' %]
181 [% m.code | html %] [% m.msg | html %]
186 [% IF op == 'view' %]
187 <h1>Contents of <em>[% shelf.shelfname | html %]</em></h1>
189 <div class="pages">[% pagination_bar | $raw %]</div>
190 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
191 <input type="hidden" name="op" value="remove_biblios" />
192 <input type="hidden" name="referer" value="view" />
193 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
195 [% IF direction == 'asc' %]
196 [% SET new_direction = 'desc' %]
198 [% SET direction = 'desc' %]
199 [% SET new_direction = 'asc' %]
203 <div id="searchheader" class="searchheader noprint">
204 <div id="selection_ops"><span class="checkall"></span> |
205 <span class="clearall"></span>
207 <span class="addto">| </span>
209 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
210 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
212 [% IF can_remove_biblios %]
213 <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>
215 [% 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 %]
220 <table id="searchresults" class="dataTable">
223 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
225 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
226 [% IF sortfield == 'title' %]
227 <th class="sorting_[% direction | html %]">
231 <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>
233 [% IF sortfield == 'author' %]
234 <th class="sorting_[% direction | html %]">
238 <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>
240 [% IF sortfield == 'dateadded' %]
241 <th class="sorting_[% direction | html %]">
245 <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>
247 [% IF sortfield == 'itemcallnumber' %]
248 <th class="sorting_[% direction | html %]">
252 <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>
256 [% FOREACH itemsloo IN itemsloop %]
260 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
263 [% UNLESS ( item_level_itypes ) %]<td>
264 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />[% END %][% itemsloo.description | html %]
267 [% IF ( itemsloo.XSLTBloc ) %]
268 [% itemsloo.XSLTBloc | $raw %]
270 [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
274 [% IF ( itemsloo.notforloan ) %]
275 <span class="noholdstext">No holds allowed</span>
277 [% IF ( itemsloo.ITEM_RESULTS.size ) %]
278 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
279 [% 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 %]
281 <span class="noholdstext">No holds allowed</span>
284 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
285 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
287 [% IF ( CAN_user_editcatalogue_edit_items ) %]
288 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
292 <td>[% itemsloo.author | html %]</td>
293 <td>[% itemsloo.dateadded | $KohaDates%]</td>
296 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
298 [% result.holdingbranch | html %]
299 [% IF ( result.location_intranet ) %]<span class="shelvingloc">[% result.location_intranet | html %]</span>[% END %]
300 [% IF ( result.itemcallnumber ) %]
301 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>]
308 [% END %]<!-- /itemsloop -->
310 <div class="pages">[% pagination_bar | $raw %]</div>
316 [% IF op == 'add_form' OR op == 'edit_form' %]
318 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
319 <fieldset class="rows">
321 [% IF op == 'add_form' %]
322 <legend><h1>Create a new list</h1></legend>
323 <input type="hidden" name="op" value="add" />
325 <legend><h1>Edit list <em>[% shelf.shelfname | html %]</em></h1></legend>
326 <input type="hidden" name="op" value="edit" />
328 <input type="hidden" name="referer" value="[% referer | html %]" />
329 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
332 <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" />
333 <span class="required">Required</span>
336 <span class="label">Owner: </span>
337 [% IF op == 'add_form' %]
338 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
341 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
343 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
347 <li><label for="sortfield" >Sort this list by: </label>
348 <select name="sortfield">
349 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
350 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
351 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
352 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
353 [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
355 <li><label for="public">Public: </label>
356 <select id="public" name="public" onchange="AdjustRemark()">
357 [% IF shelf.is_private %]
358 <option value="0" selected="selected">Private</option>
360 <option value="0">Private</option>
362 [% IF shelf.is_public %]
363 <option value="1" selected="selected">Public</option>
365 <option value="1">Public</option>
369 [% INCLUDE list_permissions %]
374 <fieldset class="action">
375 <input type="submit" value="Save" class="submit" />
376 [% IF referer == 'view' %]
377 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
380 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1" class="cancel">Cancel</a>
382 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0" class="cancel">Cancel</a>
390 [% IF op == 'list' %]
392 <div id="tabs" class="toptabs">
394 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
395 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
398 <div id="tab_content">
399 <table id="listresultst">
402 <th class="NoVisible">Type</th>
408 <th>Creation date</th>
409 <th>Modification date</th>
410 <th class="noExport">Actions</th>
412 <tr class="filters_row">
414 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
417 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
419 <select class="filter text_filter" id="searchsortby_filter">
420 <option value=""></option>
421 <option value="title">Title</option>
422 <option value="author">Author</option>
423 <option value="copyrightdate">Copyrightdate</option>
424 <option value="itemcallnumber">Call number</option>
425 <option value="dateadded">Date added</option>
439 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
440 <!-- Values will be set here by placeHold() -->
444 </div> <!-- /.col-sm-10.col-sm-push-2 -->
445 </div> <!-- /.row -->
447 [% IF ( can_add_biblios ) %]
449 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
450 <div class="modal-dialog" role="document">
451 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
452 <div class="modal-content">
453 <div class="modal-header">
454 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
455 <h4 class="modal-title" id="addToListLabel">Add items</h4>
457 <div class="modal-body">
458 <fieldset class="brief">
461 <label for="barcodes">Barcodes:</label>
462 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
463 <input type="hidden" name="op" value="add_biblio" />
464 <input type="hidden" name="referer" value="view" />
465 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
468 <label for="biblionumbers">Biblio numbers:</label>
469 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
470 <input type="hidden" name="op" value="add_biblio" />
471 <input type="hidden" name="referer" value="view" />
472 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
477 <div class="modal-footer">
478 <button type="submit" class="btn btn-default">Save</button>
479 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
487 [% MACRO jsinclude BLOCK %]
488 [% INCLUDE 'datatables.inc' %]
489 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
492 $( document ).ready(function() {
494 window.onafterprint = function () {
497 setTimeout('window.close()', 1000); // Hack for Chrome < 63
502 [% IF op == 'view' %]
503 [% Asset.js("lib/hc-sticky.js") | $raw %]
506 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
507 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
508 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
510 [% IF op == 'list' %]
511 $(document).ready(function(){
512 var public = [% public | html %];
514 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
515 "aaSorting": [[ 5, "asc" ]],
517 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
518 'fnServerData': function(sSource, aoData, fnCallback) {
524 'value': $("#searchshelfname_filter").val(),
527 'value': $("#searchowner_filter").val(),
530 'value': $("#searchsortby_filter").val(),
532 'name': 'template_path',
533 'value': 'virtualshelves/tables/shelves_results.tt',
535 'name': 'shelfname_sorton',
536 'value': 'vs.shelfname',
538 'name': 'is_shared_sorton',
539 'value': 'vs.public',
541 'name': 'owner_sorton',
544 'name': 'sortby_sorton',
545 'value': 'vs.sortfield',
547 'name': 'created_on_sorton',
548 'value': 'vs.created_on',
550 'name': 'modification_time_sorton',
551 'value': 'vs.lastmodified',
558 'success': function(json){
564 { 'mDataProp': 'dt_public' },
565 { 'mDataProp': 'dt_shelfname' },
566 { 'mDataProp': 'dt_count' },
567 { 'mDataProp': 'dt_is_shared' },
568 { 'mDataProp': 'dt_owner' },
569 { 'mDataProp': 'dt_sortby' },
570 { 'mDataProp': 'dt_created_on' },
571 { 'mDataProp': 'dt_modification_time' },
572 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
575 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
578 'sPaginationType': 'full_numbers',
581 "bSortCellsTop": true
584 dtListResults.fnAddFilters("filter", 750);
586 var tabs = $("#tabs").tabs({
592 activate: function(e, ui) {
593 var active = tabs.tabs("option", "active" );
596 dtListResults.fnDraw();
597 } else if ( active == 1 ) {
599 dtListResults.fnDraw();
603 $("body").on("click", ".deleteshelf", function(){
604 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
609 [% IF shelf AND op == 'view' %]
611 $(document).ready(function(){
612 Sticky = $("#searchheader");
614 stickTo: "#listform",
615 stickyClass: "floating"
617 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
618 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
619 $("#CheckAll").click(function(e){
621 $(".selection").each(function(){
622 $(this).prop("checked", true);
626 $("#CheckNone").click(function(e){
628 $(".selection").each(function(){
629 $(this).prop("checked", false);
632 $(".placehold").on("click",function(e){
636 $(".addtocart").show();
637 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
638 [% IF (Koha.Preference("intranetbookbag")) %]
639 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
641 [% IF Koha.Preference('virtualshelves') %]
642 [% IF add_to_some_private_shelves.count %]
643 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
644 [% SET number_of_private_shelves = 0 %]
645 [% FOREACH s IN add_to_some_private_shelves %]
646 [% IF shelfnumber != s.shelfnumber %]
647 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
648 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
649 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
652 param1 += "<\/optgroup>";
654 [% IF add_to_some_public_shelves.count %]
655 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
656 [% SET number_of_public_shelves = 0 %]
657 [% FOREACH s IN add_to_some_public_shelves %]
658 [% IF shelfnumber != s.shelfnumber %]
659 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
660 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
661 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
664 param1 += "<\/optgroup>";
666 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
667 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
669 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
671 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
672 $("span.addto").html(param1);
673 $("#cartsubmit").on("click",function(e){
677 $("#addto").change(function(){
680 $(".addto").find("input:submit").click(function(e){
684 $("#selection_ops").show();
685 $(".merge-items").on("click",function(e){
689 $("#listform").on("submit",function(e){
692 $(".list-remove").on("click",function(e){
693 if($(".selection").filter(":checked").length > 0){
694 return confirm(MSG_REMOVE_FROM_LIST);
696 alert(MSG_NO_ITEM_SELECTED);
700 $("#addToList").on("shown.bs.modal", function(e){
701 $("#barcodes").focus();
706 [% IF shelf AND op == 'edit_form' %]
707 $(document).ready(function(){
713 * This function checks if the adequate number of records are checked for merging
715 function MergeItems() {
716 var checkboxes = $("input:checkbox:checked");
717 if (checkboxes.length < 2) {
718 alert(_("At least two records must be selected for merging."));
721 $(checkboxes).each(function() {
722 params.push('biblionumber=' + $(this).val());
724 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
731 * This function checks all checkboxes if all are empty,
732 * or unchecks all if any already checked.
735 var checkboxes = document.getElementsByTagName('input');
736 var nbCheckbox = checkboxes.length;
737 var check = areAllChecked();
738 for(var i=0;i<nbCheckbox;i++){
739 if(checkboxes[i].getAttribute('type') == "checkbox" ){
740 checkboxes[i].checked = (check) ? 0 : 1;
745 * This function returns true if ALL checkboxes are checked
747 function areAllChecked(){
748 var checkboxes = document.getElementsByTagName('input');
749 var nbCheckbox = checkboxes.length;
750 for(var i=0;i<nbCheckbox;i++){
751 if(checkboxes[i].getAttribute('type') == "checkbox" ){
752 if(checkboxes[i].checked == 0){
760 function placeHold () {
761 var checkedItems = $(".selection:checked");
762 if ($(checkedItems).size() == 0) {
763 alert(MSG_NO_ITEM_SELECTED);
766 $(checkedItems).each(function() {
767 var bib_param = $("<input>").attr("type", "hidden").attr("name", "biblionumber").val($(this).val());
768 $('#hold_form').append(bib_param);
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 $("#staff_remark").hide();
807 } else if( public==0 ) {
808 // If we move to Private (without shares), show Anyone remark
809 // Note: the number of shares is not tested real-time
810 [% IF !shelf.is_shared %]
812 $("#anyone_remark").show();
813 $("#staff_remark").hide();
814 } else if ( perms==3 ) {
815 $("#anyone_remark").hide();
816 $("#staff_remark").show();
819 $("#anyone_remark").hide();
820 $("#staff_remark").hide();
822 } else { // public==1
823 $("#anyone_remark").hide();
824 $("#staff_remark").hide();
827 [% IF op == 'view' %]
830 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
833 $(document).ready(function() {
834 $("#sendlist").click(function(){
838 $("#deleteshelf").click(function(e){
839 if(confirm(_("Are you sure you want to delete this list?"))){
851 [% INCLUDE 'intranet-bottom.inc' %]