5 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
11 Contents of [% shelf.shelfname | html %] › [% END %]
13 [% IF op == 'add_form' %]
14 Create new list › [% END %]
16 [% IF op == 'edit_form' %]
17 Edit list [% shelf.shelfname | html %] › [% END %]
20 [% INCLUDE 'doc-head-close.inc' %]
21 <style>textarea { width: 100%; }</style>
23 [% BLOCK list_permissions %]
25 <label for="allow_changes_from">Allow changes to contents from: </label>
26 <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
28 [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
30 [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
31 <option value="1" selected="selected">Owner only</option>
33 <option value="1">Owner only</option>
36 [% 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 %]
38 [% IF shelf.allow_change_from_staff %]<option value="3" selected="selected">Staff only</option>[% ELSE %]<option value="3">Staff only</option>[% END %]
41   <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
42   <span id="staff_remark" style="display:none;color:red;">The Staff only permission has no actual effect while this list is strictly private.</span>
47 <body id="lists_shelves" class="lists">
48 [% INCLUDE 'header.inc' %]
49 [% INCLUDE 'cat-search.inc' %]
51 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
54 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
59 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
63 <a href="#" aria-current="page">
69 [% IF shelf AND shelf.is_private %]
70 [% IF op == 'view' OR op == 'edit_form' %]
72 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0">Your lists</a>
76 <a href="#" aria-current="page">
82 [% ELSIF shelf AND shelf.is_public %]
85 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1">Public lists</a>
89 <a href="#" aria-current="page">
98 <a href="#" aria-current="page">
99 Contents of <em>[% shelf.shelfname | html %]</em>
104 [% IF op == 'add_form' %]
106 <a href="#" aria-current="page">
112 [% IF op == 'edit_form' %]
114 <a href="#" aria-current="page">
115 Edit list <em>[% shelf.shelfname | html %]</em>
120 [% IF op == 'transfer' %]
121 <li><a href="#" aria-current="page">Transfer list <em>[% shelf.shelfname | html %]</em></a></li>
126 <div class="main container-fluid">
128 <div class="col-sm-10 col-sm-push-1">
131 [% IF op != 'transfer' %][% INCLUDE 'virtualshelves-toolbar.inc' %][% END %]
133 [% FOR m IN messages %]
134 <div class="dialog [% m.type | html %]">
136 [% CASE 'error_on_update' %]
137 <span>An error occurred when updating this list.</span>
138 [% CASE 'error_on_insert' %]
139 <span>An error occurred when creating this list.</span>
140 [% CASE 'error_on_delete' %]
141 <span>An error occurred when deleting this list.</span>
142 [% CASE 'error_on_add_biblio' %]
143 [% IF m.item_barcode %]
144 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
146 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
148 [% CASE 'success_on_update' %]
149 <span>List updated.</span>
150 [% CASE 'success_on_insert' %]
151 <span>List created.</span>
152 [% CASE 'success_on_delete' %]
153 <span>List deleted.</span>
154 [% CASE 'success_on_add_biblio' %]
155 [% IF m.item_barcode %]
156 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
158 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
160 [% CASE 'success_on_remove_biblios' %]
161 <span>The item has been removed from the list.</span>
162 [% CASE 'does_not_exist' %]
163 <span>This list does not exist.</span>
164 [% CASE 'item_does_not_exist' %]
165 [% IF m.item_barcode %]
166 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
168 <span>The record ([% m.bibnum | html %]) does not exist.</span>
170 [% CASE 'unauthorized_on_view' %]
171 <span>You do not have permission to view this list.</span>
172 [% CASE 'unauthorized_on_update' %]
173 <span>You do not have permission to update this list.</span>
174 [% CASE 'unauthorized_on_delete' %]
175 <span>You do not have permission to delete this list.</span>
176 [% CASE 'unauthorized_on_add_biblio' %]
177 <span>You do not have permission to add a record to this list.</span>
178 [% CASE 'unauthorized_transfer' %]
179 <span>You do not have permission to transfer ownership of this list.</span>
180 [% CASE 'new_owner_not_found' %]
181 <span>The new owner could not be found anymore.</span>
182 [% CASE 'no_biblio_removed' %]
183 <span>No record was removed.</span>
185 [% CASE 'Koha::Exceptions::Virtualshelf::DuplicateObject' %]
186 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
187 [% CASE 'Koha::Exceptions::Virtualshelf::UseDbAdminAccount' %]
188 <span>List could not be created. (Do not use the database administrator account.)</span>
189 [% CASE 'DBIx::Class::Exception' %]
193 [% m.code | html %] [% m.msg | html %]
198 [% IF op == 'transfer' %]
199 <h1>Transfer ownership of public list [% shelf.shelfname | html %]</h1>
201 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="transferform" method="post">
203 <input type="hidden" name="op" value="transfer" />
204 <input type="hidden" name="public" value="1" />
205 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
208 <label for="find_patron">Search for new owner: </label>
209 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
214 <label for="find_patron">New owner: </label>
215 <span id="new_owner_name"></span>
216 <input type="hidden" id="new_owner" name="new_owner" value="" />
220 <fieldset class="action">
221 <input type="submit" value="Transfer" class="submit" />
222 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1" class="cancel">Cancel</a>
229 [% IF op == 'view' %]
230 <h1>Contents of <em>[% shelf.shelfname | html %]</em></h1>
232 <div class="pages">[% pagination_bar | $raw %]</div>
233 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
234 <input type="hidden" name="op" value="remove_biblios" />
235 <input type="hidden" name="referer" value="view" />
236 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
238 [% IF direction == 'asc' %]
239 [% SET new_direction = 'desc' %]
241 [% SET direction = 'desc' %]
242 [% SET new_direction = 'asc' %]
246 <div id="searchheader" class="searchheader noprint">
247 <div id="selection_ops"><span class="checkall"></span> |
248 <span class="clearall"></span>
250 <span class="addto">| </span>
252 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
253 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
255 [% IF can_remove_biblios %]
256 <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>
258 [% 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 %]
263 <table id="searchresults" class="dataTable">
266 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
268 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
269 [% IF sortfield == 'title' %]
270 <th class="sorting_[% direction | html %]">
274 <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>
276 [% IF sortfield == 'author' %]
277 <th class="sorting_[% direction | html %]">
281 <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>
283 [% IF sortfield == 'dateadded' %]
284 <th class="sorting_[% direction | html %]">
288 <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>
290 [% IF sortfield == 'itemcallnumber' %]
291 <th class="sorting_[% direction | html %]">
295 <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>
299 [% FOREACH itemsloo IN itemsloop %]
303 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
306 [% UNLESS ( item_level_itypes ) %]<td>
307 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />[% END %][% itemsloo.description | html %]
310 [% IF ( itemsloo.XSLTBloc ) %]
311 [% itemsloo.XSLTBloc | $raw %]
313 [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
317 [% IF ( itemsloo.notforloan ) %]
318 <span class="noholdstext">No holds allowed</span>
320 [% IF ( itemsloo.ITEM_RESULTS.count ) %]
321 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
322 [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | uri %]&findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %]</a></span>[% END %]
324 <span class="noholdstext">No holds allowed</span>
327 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
328 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
330 [% IF ( CAN_user_editcatalogue_edit_items ) %]
331 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
335 <td>[% itemsloo.author | html %]</td>
336 <td>[% itemsloo.dateadded | $KohaDates%]</td>
339 [% FOREACH item IN itemsloo.ITEM_RESULTS %]
341 [% Branches.GetName(item.holdingbranch) | html %]
342 [% IF ( item.location ) %]
343 <span class="shelvingloc">
344 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
347 [% IF ( item.itemcallnumber ) %]
348 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>]
355 [% END %]<!-- /itemsloop -->
357 <div class="pages">[% pagination_bar | $raw %]</div>
363 [% IF op == 'add_form' OR op == 'edit_form' %]
365 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
366 <fieldset class="rows">
368 [% IF op == 'add_form' %]
369 <legend><h1>Create a new list</h1></legend>
370 <input type="hidden" name="op" value="add" />
372 <legend><h1>Edit list <em>[% shelf.shelfname | html %]</em></h1></legend>
373 <input type="hidden" name="op" value="edit" />
375 <input type="hidden" name="referer" value="[% referer | html %]" />
376 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
379 <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" />
380 <span class="required">Required</span>
383 <span class="label">Owner: </span>
384 [% IF op == 'add_form' %]
385 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
388 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
390 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
394 <li><label for="sortfield" >Sort this list by: </label>
395 <select name="sortfield">
396 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
397 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
398 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
399 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
400 [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
402 <li><label for="public">Public: </label>
403 <select id="public" name="public" onchange="AdjustRemark()">
404 [% IF shelf.is_private %]
405 <option value="0" selected="selected">Private</option>
407 <option value="0">Private</option>
409 [% IF shelf.is_public %]
410 <option value="1" selected="selected">Public</option>
412 <option value="1">Public</option>
416 [% INCLUDE list_permissions %]
421 <fieldset class="action">
422 <input type="submit" value="Save" class="submit" />
423 [% IF referer == 'view' %]
424 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
427 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1" class="cancel">Cancel</a>
429 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0" class="cancel">Cancel</a>
437 [% IF op == 'list' %]
439 <div id="tabs" class="toptabs">
441 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
442 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
445 <div id="tab_content">
446 <table id="listresultst">
449 <th class="NoVisible">Type</th>
455 <th>Creation date</th>
456 <th>Modification date</th>
457 <th class="noExport">Actions</th>
459 <tr class="filters_row">
461 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
464 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
466 <select class="filter text_filter" id="searchsortby_filter">
467 <option value=""></option>
468 <option value="title">Title</option>
469 <option value="author">Author</option>
470 <option value="copyrightdate">Copyrightdate</option>
471 <option value="itemcallnumber">Call number</option>
472 <option value="dateadded">Date added</option>
486 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
487 <!-- Values will be set here by placeHold() -->
491 </div> <!-- /.col-sm-10.col-sm-push-2 -->
492 </div> <!-- /.row -->
494 [% IF ( can_add_biblios ) %]
496 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
497 <div class="modal-dialog" role="document">
498 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
499 <div class="modal-content">
500 <div class="modal-header">
501 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
502 <h4 class="modal-title" id="addToListLabel">Add items</h4>
504 <div class="modal-body">
505 <fieldset class="brief">
508 <label for="barcodes">Barcodes:</label>
509 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
510 <input type="hidden" name="op" value="add_biblio" />
511 <input type="hidden" name="referer" value="view" />
512 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
515 <label for="biblionumbers">Biblio numbers:</label>
516 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
517 <input type="hidden" name="op" value="add_biblio" />
518 <input type="hidden" name="referer" value="view" />
519 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
524 <div class="modal-footer">
525 <button type="submit" class="btn btn-default">Save</button>
526 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
534 [% MACRO jsinclude BLOCK %]
535 [% INCLUDE 'datatables.inc' %]
536 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
539 $( document ).ready(function() {
541 window.onafterprint = function () {
544 setTimeout('window.close()', 1000); // Hack for Chrome < 63
549 [% IF op == 'view' %]
550 [% Asset.js("lib/hc-sticky.js") | $raw %]
553 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
554 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
555 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
557 [% IF op == 'list' %]
558 $(document).ready(function(){
559 var public = [% public | html %];
561 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
562 "aaSorting": [[ 5, "asc" ]],
564 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
565 'fnServerData': function(sSource, aoData, fnCallback) {
571 'value': $("#searchshelfname_filter").val(),
574 'value': $("#searchowner_filter").val(),
577 'value': $("#searchsortby_filter").val(),
579 'name': 'template_path',
580 'value': 'virtualshelves/tables/shelves_results.tt',
582 'name': 'allow_transfer',
583 'value': '[% allow_transfer | html %]',
585 'name': 'shelfname_sorton',
586 'value': 'vs.shelfname',
588 'name': 'is_shared_sorton',
589 'value': 'vs.public',
591 'name': 'owner_sorton',
594 'name': 'sortby_sorton',
595 'value': 'vs.sortfield',
597 'name': 'created_on_sorton',
598 'value': 'vs.created_on',
600 'name': 'modification_time_sorton',
601 'value': 'vs.lastmodified',
608 'success': function(json){
614 { 'mDataProp': 'dt_public' },
615 { 'mDataProp': 'dt_shelfname' },
616 { 'mDataProp': 'dt_count' },
617 { 'mDataProp': 'dt_is_shared' },
618 { 'mDataProp': 'dt_owner' },
619 { 'mDataProp': 'dt_sortby' },
620 { 'mDataProp': 'dt_created_on' },
621 { 'mDataProp': 'dt_modification_time' },
622 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
625 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
628 'sPaginationType': 'full_numbers',
631 "bSortCellsTop": true
634 dtListResults.fnAddFilters("filter", 750);
636 var tabs = $("#tabs").tabs({
642 activate: function(e, ui) {
643 var active = tabs.tabs("option", "active" );
646 dtListResults.fnDraw();
647 } else if ( active == 1 ) {
649 dtListResults.fnDraw();
653 $("body").on("click", ".deleteshelf", function(){
654 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
659 [% IF shelf AND op == 'view' %]
661 $(document).ready(function(){
662 Sticky = $("#searchheader");
664 stickTo: "#listform",
665 stickyClass: "floating"
667 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
668 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
669 $("#CheckAll").click(function(e){
671 $(".selection").each(function(){
672 $(this).prop("checked", true);
676 $("#CheckNone").click(function(e){
678 $(".selection").each(function(){
679 $(this).prop("checked", false);
682 $(".placehold").on("click",function(e){
686 $(".addtocart").show();
687 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
688 [% IF (Koha.Preference("intranetbookbag")) %]
689 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
691 [% IF Koha.Preference('virtualshelves') %]
692 [% IF add_to_some_private_shelves.count %]
693 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
694 [% SET number_of_private_shelves = 0 %]
695 [% FOREACH s IN add_to_some_private_shelves %]
696 [% IF shelfnumber != s.shelfnumber %]
697 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
698 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
699 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
702 param1 += "<\/optgroup>";
704 [% IF add_to_some_public_shelves.count %]
705 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
706 [% SET number_of_public_shelves = 0 %]
707 [% FOREACH s IN add_to_some_public_shelves %]
708 [% IF shelfnumber != s.shelfnumber %]
709 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
710 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
711 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
714 param1 += "<\/optgroup>";
716 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
717 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
719 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
721 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
722 $("span.addto").html(param1);
723 $("#cartsubmit").on("click",function(e){
727 $("#addto").change(function(){
730 $(".addto").find("input:submit").click(function(e){
734 $("#selection_ops").show();
735 $(".merge-items").on("click",function(e){
739 $("#listform").on("submit",function(e){
742 $(".list-remove").on("click",function(e){
743 if($(".selection").filter(":checked").length > 0){
744 return confirm(MSG_REMOVE_FROM_LIST);
746 alert(MSG_NO_ITEM_SELECTED);
750 $("#addToList").on("shown.bs.modal", function(e){
751 $("#barcodes").focus();
756 [% IF shelf AND op == 'edit_form' %]
757 $(document).ready(function(){
763 * This function checks if the adequate number of records are checked for merging
765 function MergeItems() {
766 var checkboxes = $("input:checkbox:checked");
767 if (checkboxes.length < 2) {
768 alert(_("At least two records must be selected for merging."));
771 $(checkboxes).each(function() {
772 params.push('biblionumber=' + $(this).val());
774 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
781 * This function checks all checkboxes if all are empty,
782 * or unchecks all if any already checked.
785 var checkboxes = document.getElementsByTagName('input');
786 var nbCheckbox = checkboxes.length;
787 var check = areAllChecked();
788 for(var i=0;i<nbCheckbox;i++){
789 if(checkboxes[i].getAttribute('type') == "checkbox" ){
790 checkboxes[i].checked = (check) ? 0 : 1;
795 * This function returns true if ALL checkboxes are checked
797 function areAllChecked(){
798 var checkboxes = document.getElementsByTagName('input');
799 var nbCheckbox = checkboxes.length;
800 for(var i=0;i<nbCheckbox;i++){
801 if(checkboxes[i].getAttribute('type') == "checkbox" ){
802 if(checkboxes[i].checked == 0){
810 function placeHold () {
811 var checkedItems = $(".selection:checked");
812 if ($(checkedItems).size() == 0) {
813 alert(MSG_NO_ITEM_SELECTED);
816 $(checkedItems).each(function() {
817 var bib_param = $("<input>").attr("type", "hidden").attr("name", "biblionumber").val($(this).val());
818 $('#hold_form').append(bib_param);
820 $("#hold_form").submit();
825 var checkboxes = $("#searchresults").find(":checkbox");
826 var vshelf = vShelfAdd(checkboxes);
827 if($("#addto").find("option:selected").attr("value") == "addtolist"){
828 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
830 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
833 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
835 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
838 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
840 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
844 if($("#addto").find("option:selected").attr("value") == "addtocart"){
845 addMultiple(checkboxes);
850 function AdjustRemark() {
851 var public = $("#public").val();
852 var perms = $("#allow_changes_from").val();
855 $("#anyone_remark").hide();
856 $("#staff_remark").hide();
857 } else if( public==0 ) {
858 // If we move to Private (without shares), show Anyone remark
859 // Note: the number of shares is not tested real-time
860 [% IF !shelf.is_shared %]
862 $("#anyone_remark").show();
863 $("#staff_remark").hide();
864 } else if ( perms==3 ) {
865 $("#anyone_remark").hide();
866 $("#staff_remark").show();
869 $("#anyone_remark").hide();
870 $("#staff_remark").hide();
872 } else { // public==1
873 $("#anyone_remark").hide();
874 $("#staff_remark").hide();
877 [% IF op == 'view' %]
880 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
883 $(document).ready(function() {
884 $("#sendlist").click(function(){
888 $("#deleteshelf").click(function(e){
889 if(confirm(_("Are you sure you want to delete this list?"))){
899 [% IF op == 'transfer' %]
900 $(document).ready(function() {
901 patron_autocomplete( $("#find_patron"), { 'on-select-callback': function( event, ui ) {
902 $('#new_owner_name').html( ui.item.firstname + " " + ui.item.surname );
903 $('#new_owner').val( ui.item.patron_id );
904 $('#find_patron').val('').focus();
908 $('#transferform').submit(function() {
909 if( $('#new_owner').val() == '' ) {
910 alert( _("Please select a new owner first") );
921 [% INCLUDE 'intranet-bottom.inc' %]