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 %]
29 <option value="0">Nobody</option>
31 <option value="0" selected="selected">Nobody</option>
34 [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
35 <option value="1" selected="selected">Owner only</option>
37 <option value="1">Owner only</option>
40 [% IF shelf.allow_change_from_others %]
41 <option value="2" selected="selected">Anyone seeing this list</option>
43 <option value="2">Anyone seeing this list</option>
46 [% IF shelf.allow_change_from_staff %]
47 <option value="3" selected="selected">Staff only</option>
49 <option value="3">Staff only</option>
52   <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
53   <span id="staff_remark" style="display:none;color:red;">The Staff only permission has no actual effect while this list is strictly private.</span>
58 <body id="lists_shelves" class="lists">
59 [% INCLUDE 'header.inc' %]
60 [% INCLUDE 'cat-search.inc' %]
62 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
65 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
70 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
74 <a href="#" aria-current="page">
80 [% IF shelf AND shelf.is_private %]
81 [% IF op == 'view' OR op == 'edit_form' %]
83 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0">Your lists</a>
87 <a href="#" aria-current="page">
93 [% ELSIF shelf AND shelf.is_public %]
96 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1">Public lists</a>
100 <a href="#" aria-current="page">
107 [% IF op == 'view' %]
109 <a href="#" aria-current="page">
110 Contents of <em>[% shelf.shelfname | html %]</em>
115 [% IF op == 'add_form' %]
117 <a href="#" aria-current="page">
123 [% IF op == 'edit_form' %]
125 <a href="#" aria-current="page">
126 Edit list <em>[% shelf.shelfname | html %]</em>
131 [% IF op == 'transfer' %]
133 <a href="#" aria-current="page">Transfer list <em>[% shelf.shelfname | html %]</em></a>
139 <div class="main container-fluid">
141 <div class="col-sm-10 col-sm-push-1">
144 [% IF op != 'transfer' %][% INCLUDE 'virtualshelves-toolbar.inc' %][% END %]
146 [% FOR m IN messages %]
147 <div class="dialog [% m.type | html %]">
149 [% CASE 'error_on_update' %]
150 <span>An error occurred when updating this list.</span>
151 [% CASE 'error_on_insert' %]
152 <span>An error occurred when creating this list.</span>
153 [% CASE 'error_on_delete' %]
154 <span>An error occurred when deleting this list.</span>
155 [% CASE 'error_on_add_biblio' %]
156 [% IF m.item_barcode %]
157 <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
159 <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
161 [% CASE 'success_on_update' %]
162 <span>List updated.</span>
163 [% CASE 'success_on_insert' %]
164 <span>List created.</span>
165 [% CASE 'success_on_delete' %]
166 <span>List deleted.</span>
167 [% CASE 'success_on_add_biblio' %]
168 [% IF m.item_barcode %]
169 <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
171 <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
173 [% CASE 'success_on_remove_biblios' %]
174 <span>The item has been removed from the list.</span>
175 [% CASE 'does_not_exist' %]
176 <span>This list does not exist.</span>
177 [% CASE 'item_does_not_exist' %]
178 [% IF m.item_barcode %]
179 <span>The item ([% m.item_barcode | html %]) does not exist.</span>
181 <span>The record ([% m.bibnum | html %]) does not exist.</span>
183 [% CASE 'unauthorized_on_view' %]
184 <span>You do not have permission to view this list.</span>
185 [% CASE 'unauthorized_on_update' %]
186 <span>You do not have permission to update this list.</span>
187 [% CASE 'unauthorized_on_delete' %]
188 <span>You do not have permission to delete this list.</span>
189 [% CASE 'unauthorized_on_add_biblio' %]
190 <span>You do not have permission to add a record to this list.</span>
191 [% CASE 'unauthorized_transfer' %]
192 <span>You do not have permission to transfer ownership of this list.</span>
193 [% CASE 'new_owner_not_found' %]
194 <span>The new owner could not be found anymore.</span>
195 [% CASE 'no_biblio_removed' %]
196 <span>No record was removed.</span>
198 [% CASE 'Koha::Exceptions::Virtualshelf::DuplicateObject' %]
199 <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span>
200 [% CASE 'Koha::Exceptions::Virtualshelf::UseDbAdminAccount' %]
201 <span>List could not be created. (Do not use the database administrator account.)</span>
202 [% CASE 'DBIx::Class::Exception' %]
206 [% m.code | html %] [% m.msg | html %]
211 [% IF op == 'transfer' %]
212 <h1>Transfer ownership of public list [% shelf.shelfname | html %]</h1>
214 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="transferform" method="post">
216 <input type="hidden" name="op" value="transfer" />
217 <input type="hidden" name="public" value="1" />
218 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
221 <label for="find_patron">Search for new owner: </label>
222 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
227 <label for="find_patron">New owner: </label>
228 <span id="new_owner_name"></span>
229 <input type="hidden" id="new_owner" name="new_owner" value="" />
233 <fieldset class="action">
234 <input type="submit" value="Transfer" class="submit" />
235 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1" class="cancel">Cancel</a>
242 [% IF op == 'view' %]
243 <h1>Contents of <em>[% shelf.shelfname | html %]</em></h1>
245 <div class="pages">[% pagination_bar | $raw %]</div>
246 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
247 <input type="hidden" name="op" value="remove_biblios" />
248 <input type="hidden" name="referer" value="view" />
249 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
251 [% IF direction == 'asc' %]
252 [% SET new_direction = 'desc' %]
254 [% SET direction = 'desc' %]
255 [% SET new_direction = 'asc' %]
259 <div id="searchheader" class="searchheader noprint">
260 <div id="selection_ops">
261 <span class="checkall"></span> |
262 <span class="clearall"></span>
264 <span class="addto">| </span>
266 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
267 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
269 [% IF can_remove_biblios %]
270 <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>
272 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
273 <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>
279 <table id="searchresults" class="dataTable">
282 [% IF ( itemsloop ) %]
283 <th class="checkall"> </th>
285 [% UNLESS ( item_level_itypes ) %]
288 [% IF sortfield == 'title' %]
289 <th class="sorting_[% direction | html %]">
293 <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>
295 [% IF sortfield == 'author' %]
296 <th class="sorting_[% direction | html %]">
300 <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>
302 [% IF sortfield == 'dateadded' %]
303 <th class="sorting_[% direction | html %]">
307 <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>
309 [% IF sortfield == 'itemcallnumber' %]
310 <th class="sorting_[% direction | html %]">
314 <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>
318 [% FOREACH itemsloo IN itemsloop %]
322 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" />
325 [% UNLESS ( item_level_itypes ) %]
327 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]
328 <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />
330 [% itemsloo.description | html %]
334 [% IF ( itemsloo.XSLTBloc ) %]
335 [% itemsloo.XSLTBloc | $raw %]
337 [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %]
341 [% IF ( itemsloo.notforloan ) %]
342 <span class="noholdstext">No holds allowed</span>
344 [% IF ( itemsloo.ITEM_RESULTS.count ) %]
345 <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
347 <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>
350 <span class="noholdstext">No holds allowed</span>
353 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
354 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a>
356 [% IF ( CAN_user_editcatalogue_edit_items ) %]
357 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a>
362 [% itemsloo.author | html %]
365 [% itemsloo.dateadded | $KohaDates%]
369 [% FOREACH item IN itemsloo.ITEM_RESULTS %]
371 [% Branches.GetName(item.holdingbranch) | html %]
372 [% IF ( item.location ) %]
373 <span class="shelvingloc">
374 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
377 [% IF ( item.itemcallnumber ) %]
378 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>]
385 [% END %]<!-- /itemsloop -->
387 <div class="pages">[% pagination_bar | $raw %]</div>
392 [% IF op == 'add_form' OR op == 'edit_form' %]
394 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
395 <fieldset class="rows">
396 [% IF op == 'add_form' %]
397 <legend><h1>Create a new list</h1></legend>
398 <input type="hidden" name="op" value="add" />
400 <legend><h1>Edit list <em>[% shelf.shelfname | html %]</em></h1></legend>
401 <input type="hidden" name="op" value="edit" />
403 <input type="hidden" name="referer" value="[% referer | html %]" />
404 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
407 <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" />
408 <span class="required">Required</span>
411 <span class="label">Owner: </span>
412 [% IF op == 'add_form' %]
413 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
416 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber | html %]" />[% owner.firstname _ ' ' _ owner.surname | html %]
418 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber | html %]" />[% logged_in_user.userid | html %]
423 <label for="sortfield" >Sort this list by: </label>
424 <select name="sortfield">
425 [% IF shelf.sortfield == "title" %]
426 <option value="title" selected="selected">Title</option>
428 <option value="title">Title</option>
430 [% IF shelf.sortfield == "author" %]
431 <option value="author" selected="selected">Author</option>
433 <option value="author">Author</option>
435 [% IF shelf.sortfield == "copyrightdate" %]
436 <option value="copyrightdate" selected="selected">Copyrightdate</option>
438 <option value="copyrightdate">Copyrightdate</option>
440 [% IF shelf.sortfield == "itemcallnumber" %]
441 <option value="itemcallnumber" selected="selected">Call number</option>
443 <option value="itemcallnumber">Call number</option>
445 [% IF shelf.sortfield == "dateadded" %]
446 <option value="dateadded" selected="selected">Date added</option>
448 <option value="dateadded">Date added</option>
453 <label for="public">Public: </label>
454 <select id="public" name="public" onchange="AdjustRemark()">
455 [% IF shelf.is_private %]
456 <option value="0" selected="selected">Private</option>
458 <option value="0">Private</option>
460 [% IF shelf.is_public %]
461 <option value="1" selected="selected">Public</option>
463 <option value="1">Public</option>
467 [% INCLUDE list_permissions %]
471 <fieldset class="action">
472 <input type="submit" value="Save" class="submit" />
473 [% IF referer == 'view' %]
474 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
477 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1" class="cancel">Cancel</a>
479 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0" class="cancel">Cancel</a>
486 [% IF op == 'list' %]
488 <div id="tabs" class="toptabs">
490 <li id="privateshelves_tab" class="active">
491 <a href="#tab_content">Your lists</a>
493 <li id="publicshelves_tab" class="active">
494 <a href="#tab_content">Public lists</a>
498 <div id="tab_content">
499 <table id="listresultst">
502 <th class="NoVisible">Type</th>
508 <th>Creation date</th>
509 <th>Modification date</th>
510 <th class="noExport">Actions</th>
512 <tr class="filters_row">
514 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
517 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
519 <select class="filter text_filter" id="searchsortby_filter">
520 <option value=""></option>
521 <option value="title">Title</option>
522 <option value="author">Author</option>
523 <option value="copyrightdate">Copyrightdate</option>
524 <option value="itemcallnumber">Call number</option>
525 <option value="dateadded">Date added</option>
539 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
540 <!-- Values will be set here by placeHold() -->
544 </div> <!-- /.col-sm-10.col-sm-push-2 -->
545 </div> <!-- /.row -->
547 [% IF ( can_add_biblios ) %]
549 <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
550 <div class="modal-dialog" role="document">
551 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
552 <div class="modal-content">
553 <div class="modal-header">
554 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
555 <h4 class="modal-title" id="addToListLabel">Add items</h4>
557 <div class="modal-body">
558 <fieldset class="brief">
561 <label for="barcodes">Barcodes:</label>
562 <textarea name="barcodes" id="barcodes" rows="5"></textarea>
563 <input type="hidden" name="op" value="add_biblio" />
564 <input type="hidden" name="referer" value="view" />
565 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
568 <label for="biblionumbers">Biblio numbers:</label>
569 <textarea name="biblionumbers" id="biblionumbers" rows="5"></textarea>
570 <input type="hidden" name="op" value="add_biblio" />
571 <input type="hidden" name="referer" value="view" />
572 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
577 <div class="modal-footer">
578 <button type="submit" class="btn btn-default">Save</button>
579 <a href="#" data-dismiss="modal" class="cancel">Cancel</a>
587 [% MACRO jsinclude BLOCK %]
588 [% INCLUDE 'datatables.inc' %]
589 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
592 $( document ).ready(function() {
594 window.onafterprint = function () {
597 setTimeout('window.close()', 1000); // Hack for Chrome < 63
602 [% IF op == 'view' %]
603 [% Asset.js("lib/hc-sticky.js") | $raw %]
606 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
607 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
608 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
610 [% IF op == 'list' %]
611 $(document).ready(function(){
612 var public = [% public | html %];
614 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
615 "aaSorting": [[ 5, "asc" ]],
617 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
618 'fnServerData': function(sSource, aoData, fnCallback) {
624 'value': $("#searchshelfname_filter").val(),
627 'value': $("#searchowner_filter").val(),
630 'value': $("#searchsortby_filter").val(),
632 'name': 'template_path',
633 'value': 'virtualshelves/tables/shelves_results.tt',
635 'name': 'allow_transfer',
636 'value': '[% allow_transfer | html %]',
638 'name': 'shelfname_sorton',
639 'value': 'vs.shelfname',
641 'name': 'is_shared_sorton',
642 'value': 'vs.public',
644 'name': 'owner_sorton',
647 'name': 'sortby_sorton',
648 'value': 'vs.sortfield',
650 'name': 'created_on_sorton',
651 'value': 'vs.created_on',
653 'name': 'modification_time_sorton',
654 'value': 'vs.lastmodified',
661 'success': function(json){
667 { 'mDataProp': 'dt_public' },
668 { 'mDataProp': 'dt_shelfname' },
669 { 'mDataProp': 'dt_count' },
670 { 'mDataProp': 'dt_is_shared' },
671 { 'mDataProp': 'dt_owner' },
672 { 'mDataProp': 'dt_sortby' },
673 { 'mDataProp': 'dt_created_on' },
674 { 'mDataProp': 'dt_modification_time' },
675 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
678 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
681 'sPaginationType': 'full_numbers',
684 "bSortCellsTop": true
687 dtListResults.fnAddFilters("filter", 750);
689 var tabs = $("#tabs").tabs({
695 activate: function(e, ui) {
696 var active = tabs.tabs("option", "active" );
699 dtListResults.fnDraw();
700 } else if ( active == 1 ) {
702 dtListResults.fnDraw();
706 $("body").on("click", ".deleteshelf", function(){
707 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
712 [% IF shelf AND op == 'view' %]
714 $(document).ready(function(){
715 Sticky = $("#searchheader");
717 stickTo: "#listform",
718 stickyClass: "floating"
720 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
721 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
722 $("#CheckAll").click(function(e){
724 $(".selection").each(function(){
725 $(this).prop("checked", true);
729 $("#CheckNone").click(function(e){
731 $(".selection").each(function(){
732 $(this).prop("checked", false);
735 $(".placehold").on("click",function(e){
739 $(".addtocart").show();
740 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
741 [% IF (Koha.Preference("intranetbookbag")) %]
742 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
744 [% IF Koha.Preference('virtualshelves') %]
745 [% IF add_to_some_private_shelves.count %]
746 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
747 [% SET number_of_private_shelves = 0 %]
748 [% FOREACH s IN add_to_some_private_shelves %]
749 [% IF shelfnumber != s.shelfnumber %]
750 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
751 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
752 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
755 param1 += "<\/optgroup>";
757 [% IF add_to_some_public_shelves.count %]
758 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
759 [% SET number_of_public_shelves = 0 %]
760 [% FOREACH s IN add_to_some_public_shelves %]
761 [% IF shelfnumber != s.shelfnumber %]
762 param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
763 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
764 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
767 param1 += "<\/optgroup>";
769 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
770 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
772 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
774 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
775 $("span.addto").html(param1);
776 $("#cartsubmit").on("click",function(e){
780 $("#addto").change(function(){
783 $(".addto").find("input:submit").click(function(e){
787 $("#selection_ops").show();
788 $(".merge-items").on("click",function(e){
792 $("#listform").on("submit",function(e){
795 $(".list-remove").on("click",function(e){
796 if($(".selection").filter(":checked").length > 0){
797 return confirm(MSG_REMOVE_FROM_LIST);
799 alert(MSG_NO_ITEM_SELECTED);
803 $("#addToList").on("shown.bs.modal", function(e){
804 $("#barcodes").focus();
809 [% IF shelf AND op == 'edit_form' %]
810 $(document).ready(function(){
816 * This function checks if the adequate number of records are checked for merging
818 function MergeItems() {
819 var checkboxes = $("input:checkbox:checked");
820 if (checkboxes.length < 2) {
821 alert(_("At least two records must be selected for merging."));
824 $(checkboxes).each(function() {
825 params.push('biblionumber=' + $(this).val());
827 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
834 * This function checks all checkboxes if all are empty,
835 * or unchecks all if any already checked.
838 var checkboxes = document.getElementsByTagName('input');
839 var nbCheckbox = checkboxes.length;
840 var check = areAllChecked();
841 for(var i=0;i<nbCheckbox;i++){
842 if(checkboxes[i].getAttribute('type') == "checkbox" ){
843 checkboxes[i].checked = (check) ? 0 : 1;
848 * This function returns true if ALL checkboxes are checked
850 function areAllChecked(){
851 var checkboxes = document.getElementsByTagName('input');
852 var nbCheckbox = checkboxes.length;
853 for(var i=0;i<nbCheckbox;i++){
854 if(checkboxes[i].getAttribute('type') == "checkbox" ){
855 if(checkboxes[i].checked == 0){
863 function placeHold () {
864 var checkedItems = $(".selection:checked");
865 if ($(checkedItems).size() == 0) {
866 alert(MSG_NO_ITEM_SELECTED);
869 $(checkedItems).each(function() {
870 var bib_param = $("<input>").attr("type", "hidden").attr("name", "biblionumber").val($(this).val());
871 $('#hold_form').append(bib_param);
873 $("#hold_form").submit();
878 var checkboxes = $("#searchresults").find(":checkbox");
879 var vshelf = vShelfAdd(checkboxes);
880 if($("#addto").find("option:selected").attr("value") == "addtolist"){
881 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
883 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
886 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
888 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
891 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
893 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
897 if($("#addto").find("option:selected").attr("value") == "addtocart"){
898 addMultiple(checkboxes);
903 function AdjustRemark() {
904 var public = $("#public").val();
905 var perms = $("#allow_changes_from").val();
908 $("#anyone_remark").hide();
909 $("#staff_remark").hide();
910 } else if( public==0 ) {
911 // If we move to Private (without shares), show Anyone remark
912 // Note: the number of shares is not tested real-time
913 [% IF !shelf.is_shared %]
915 $("#anyone_remark").show();
916 $("#staff_remark").hide();
917 } else if ( perms==3 ) {
918 $("#anyone_remark").hide();
919 $("#staff_remark").show();
922 $("#anyone_remark").hide();
923 $("#staff_remark").hide();
925 } else { // public==1
926 $("#anyone_remark").hide();
927 $("#staff_remark").hide();
930 [% IF op == 'view' %]
933 open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
936 $(document).ready(function() {
937 $("#sendlist").click(function(){
941 $("#deleteshelf").click(function(e){
942 if(confirm(_("Are you sure you want to delete this list?"))){
952 [% IF op == 'transfer' %]
953 $(document).ready(function() {
954 patron_autocomplete( $("#find_patron"), { 'on-select-callback': function( event, ui ) {
955 $('#new_owner_name').html( ui.item.firstname + " " + ui.item.surname );
956 $('#new_owner').val( ui.item.patron_id );
957 $('#find_patron').val('').focus();
961 $('#transferform').submit(function() {
962 if( $('#new_owner').val() == '' ) {
963 alert( _("Please select a new owner first") );
974 [% INCLUDE 'intranet-bottom.inc' %]