5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › [% IF op == 'view' %]Lists › Contents of [% shelf.shelfname | html %][% ELSE %]Lists[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list [% shelf.shelfname | html %][% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
12 [% BLOCK list_permissions %]
14 <label for="allow_changes_from">Allow changes to contents from: </label>
15 <select name="allow_changes_from" id="allow_changes_from">
17 [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
19 [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
20 <option value="1" selected="selected">Owner only</option>
22 <option value="1">Owner only</option>
25 [% 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 %]
28   <span id="anyone_remark" style="color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
33 <script type="text/javascript">
34 $( document ).ready(function() {
36 setTimeout('window.close()', 1);
42 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
43 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
45 <script type="text/javascript">
48 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
49 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
50 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
53 $(document).ready(function(){
54 [% IF category == PUBLIC %]
55 var type = [% PUBLIC %];
57 var type = [% PRIVATE %];
59 var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
61 "aaSorting": [[ 5, "asc" ]],
63 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
64 'fnServerData': function(sSource, aoData, fnCallback) {
70 'value': $("#searchshelfname_filter").val(),
73 'value': $("#searchowner_filter").val(),
76 'value': $("#searchsortby_filter").val(),
78 'name': 'template_path',
79 'value': 'virtualshelves/tables/shelves_results.tt',
86 'success': function(json){
92 { 'mDataProp': 'dt_type' },
93 { 'mDataProp': 'dt_shelfname' },
94 { 'mDataProp': 'dt_count' },
95 { 'mDataProp': 'dt_owner' },
96 { 'mDataProp': 'dt_sortby' },
97 { 'mDataProp': 'dt_created_on' },
98 { 'mDataProp': 'dt_modification_time' },
99 { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
102 { "bVisible": false, "aTargets": [ 'NoVisible' ] }
105 'sPaginationType': 'full_numbers',
108 "bSortCellsTop": true
111 dtListResults.fnAddFilters("filter", 750);
113 var tabs = $("#tabs").tabs({
114 [% IF category == PUBLIC %]
119 activate: function(e, ui) {
120 var active = tabs.tabs("option", "active" );
122 type = [% PRIVATE %];
123 dtListResults.fnDraw();
124 } else if ( active == 1 ) {
126 dtListResults.fnDraw();
130 $("body").on("click", ".deleteshelf", function(){
131 return confirmDelete(MSG_CONFIRM_DELETE_LIST);
136 [% IF shelf AND op == 'view' %]
137 $(document).ready(function(){
138 [% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %]
139 $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
140 $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
141 $("#CheckAll").click(function(){
142 $(".checkboxed").checkCheckboxes();
145 $("#CheckNone").click(function(){
146 $(".checkboxed").unCheckCheckboxes();
149 $(".placehold").on("click",function(e){
153 $(".addtocart").show();
154 var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
155 [% IF ( intranetbookbag ) %]
156 param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
158 [% IF Koha.Preference('virtualshelves') %]
159 [% IF add_to_some_private_shelves.count %]
160 param1 += "<optgroup label=\""+_("Your lists:")+"\">";
161 [% SET number_of_private_shelves = 0 %]
162 [% FOREACH s IN add_to_some_private_shelves %]
163 [% IF shelfnumber != s.shelfnumber %]
164 param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>";
165 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
166 [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
169 param1 += "<\/optgroup>";
171 [% IF add_to_some_public_shelves.count %]
172 param1 += "<optgroup label=\""+_("Public lists:")+"\">";
173 [% SET number_of_public_shelves = 0 %]
174 [% FOREACH s IN add_to_some_public_shelves %]
175 [% IF shelfnumber != s.shelfnumber %]
176 param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>";
177 [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
178 [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
181 param1 += "<\/optgroup>";
183 [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
184 param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
186 param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
188 param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
189 $("span.addto").html(param1);
190 $("#cartsubmit").on("click",function(e){
194 $("#addto").change(function(){
197 $(".addto").find("input:submit").click(function(e){
201 $("#selection_ops").show();
202 $(".merge-items").on("click",function(e){
206 $("#listform").on("submit",function(e){
209 $(".list-remove").on("click",function(e){
210 if($(".selection").filter(":checked").length > 0){
211 return confirm(MSG_REMOVE_FROM_LIST);
213 alert(MSG_NO_ITEM_SELECTED);
221 * This function checks if the adequate number of records are checked for merging
223 function MergeItems() {
224 var checkboxes = $("input:checkbox:checked");
225 if (checkboxes.length < 2) {
226 alert(_("At least two records must be selected for merging."));
229 $(checkboxes).each(function() {
230 params.push('biblionumber=' + $(this).val());
232 var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&');
239 * This function checks all checkboxes if all are empty,
240 * or unchecks all if any already checked.
243 var checkboxes = document.getElementsByTagName('input');
244 var nbCheckbox = checkboxes.length;
245 var check = areAllChecked();
246 for(var i=0;i<nbCheckbox;i++){
247 if(checkboxes[i].getAttribute('type') == "checkbox" ){
248 checkboxes[i].checked = (check) ? 0 : 1;
253 * This function returns true if ALL checkboxes are checked
255 function areAllChecked(){
256 var checkboxes = document.getElementsByTagName('input');
257 var nbCheckbox = checkboxes.length;
258 for(var i=0;i<nbCheckbox;i++){
259 if(checkboxes[i].getAttribute('type') == "checkbox" ){
260 if(checkboxes[i].checked == 0){
268 function placeHold () {
269 var checkedItems = $(".selection:checked");
270 if ($(checkedItems).size() == 0) {
271 alert(MSG_NO_ITEM_SELECTED);
275 $(checkedItems).each(function() {
276 bibs += $(this).val() + "/";
278 $("#hold_form_biblios").val(bibs);
279 $("#hold_form").submit();
284 var checkboxes = $("#searchresults").find(":checkbox");
285 var vshelf = vShelfAdd(checkboxes);
286 if($("#addto").find("option:selected").attr("value") == "addtolist"){
287 var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
289 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
292 } else if($("#addto").find("option:selected").attr("value") == "newlist"){
294 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
297 } else if($("#addto").find("option:selected").attr("value") == "morelists"){
299 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
303 if($("#addto").find("option:selected").attr("value") == "addtocart"){
304 addMultiple(checkboxes);
311 <body id="lists_shelves" class="lists">
312 [% INCLUDE 'header.inc' %]
313 [% INCLUDE 'cat-search.inc' %]
315 <div id="breadcrumbs">
316 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
317 [% IF op != 'list' %]
318 <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a>
322 [% IF shelf AND shelf.is_private %] ›
323 [% IF op == 'view' OR op == 'edit_form' %]
324 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE %]">Your lists</a>
328 [% ELSIF shelf AND shelf.is_public %] ›
329 [% IF op == 'view' %]
330 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC %]">Public lists</a>
336 [% IF op == 'view' %]› Contents of <i>[% shelf.shelfname | html %]</i>[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list <i>[% shelf.shelfname | html %]</i>[% END %]</div>
338 <div id="doc3" class="yui-t2">
343 <div class="yui-g">[% INCLUDE 'virtualshelves-toolbar.inc' %]
346 [% FOR m IN messages %]
347 <div class="dialog [% m.type %]">
349 [% CASE 'error_on_update' %]
350 <span>An error occurred when updating this list.</span>
351 [% CASE 'error_on_insert' %]
352 <span>An error occurred when creating this list.</span>
353 [% CASE 'error_on_delete' %]
354 <span>An error occurred when deleting this list.</span>
355 [% CASE 'error_on_add_biblio' %]
356 <span>The item ([% m.item_barcode %]) has not been added to the list. Please verify it is not already in the list.</span>
357 [% CASE 'success_on_update' %]
358 <span>List updated.</span>
359 [% CASE 'success_on_insert' %]
360 <span>List created.</span>
361 [% CASE 'success_on_delete' %]
362 <span>List deleted.</span>
363 [% CASE 'success_on_add_biblio' %]
364 <span>The item ([% m.item_barcode %]) has been added to the list.</span>
365 [% CASE 'success_on_remove_biblios' %]
366 <span>The item has been removed from the list.</span>
367 [% CASE 'does_not_exist' %]
368 <span>This list does not exist.</span>
369 [% CASE 'item_does_not_exist' %]
370 <span>The item ([% m.item_barcode %]) does not exist.</span>
371 [% CASE 'unauthorized_on_view' %]
372 <span>You do not have permission to view this list.</span>
373 [% CASE 'unauthorized_on_update' %]
374 <span>You do not have permission to update this list.</span>
375 [% CASE 'unauthorized_on_delete' %]
376 <span>You do not have permission to delete this list.</span>
377 [% CASE 'unauthorized_on_add_biblio' %]
378 <span>You do not have permission to add a record to this list.</span>
379 [% CASE 'no_biblio_removed' %]
380 <span>No record was removed.</span>
381 [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
382 <span>An error occurred when creating this list. The name [% shelfname %] already exists.</span>
383 [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %]
384 <span>List could not be created. (Do not use the database administrator account.)</span>
385 [% CASE 'DBIx::Class::Exception' %]
393 [% IF op == 'view' %]
397 <h3>Contents of <i>[% shelf.shelfname | html %]</i></h3>
398 <div class="pages">[% pagination_bar %]</div>
399 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
400 <input type="hidden" name="op" value="remove_biblios" />
401 <input type="hidden" name="referer" value="view" />
402 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" />
404 [% IF direction == 'asc' %]
405 [% SET new_direction = 'desc' %]
407 [% SET direction = 'desc' %]
408 [% SET new_direction = 'asc' %]
411 <div id="searchheader" class="noprint">
413 <div id="selection_ops"><span class="checkall"></span> |
414 <span class="clearall"></span>
416 <span class="addto">| </span>
418 [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
419 <div class="btn-group"><button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
421 [% IF can_remove_biblios %]
422 <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>
424 [% 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 %]
429 <table id="searchresults">
431 [% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
433 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
435 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=title&direction=[% IF sortfield != 'title' %]asc[% ELSE %][% new_direction %][% END %]">Title</a>
436 [% IF sortfield == 'title' %]
437 <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
439 <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
443 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=author&direction=[% IF sortfield != 'author' %]asc[% ELSE %][% new_direction %][% END %]">Author</a>
444 [% IF sortfield == 'author' %]
445 <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
447 <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
452 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=itemcallnumber&direction=[% IF sortfield != 'itemcallnumber' %]asc[% ELSE %][% new_direction %][% END %]">Call number</a>
453 [% IF sortfield == 'itemcallnumber' %]
454 <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
456 <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
460 [% FOREACH itemsloo IN itemsloop %]
464 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="biblionumber" />
467 [% UNLESS ( item_level_itypes ) %]<td>
468 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />[% END %][% itemsloo.description %]
471 [% IF ( itemsloo.XSLTBloc ) %]
472 [% itemsloo.XSLTBloc %]
474 [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %]
475 [% itemsloo.title |html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield %][% END %]</a>
478 [% IF ( itemsloo.notforloan ) %]
479 <span class="noholdstext">No holds allowed</span>
481 [% IF ( itemsloo.ITEM_RESULTS.size ) %]
482 <a id="reserve_[% itemsloo.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]">Holds</a>
483 [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]&findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %]
485 <span class="noholdstext">No holds allowed</span>
488 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
489 | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber %]">Edit record</a>
491 [% IF ( CAN_user_editcatalogue_edit_items ) %]
492 | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber %]">Edit items</a>
496 <td>[% itemsloo.author %]</td>
497 <td>[% itemsloo.dateadded | $KohaDates%]</td>
500 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
501 <li>[% result.holdingbranch %] [% IF ( result.location_intranet ) %] ([% result.location_intranet %]) [% END %]
502 [% IF ( result.itemcallnumber ) %]
503 [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber %]</a>]
510 [% END %]<!-- /itemsloop -->
512 <div class="pages">[% pagination_bar %]</div>
519 [% IF op == 'add_form' OR op == 'edit_form' %]
521 <div class="yui-u first">
522 <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
523 <fieldset class="rows">
525 [% IF op == 'add_form' %]
526 <legend>Create a new list</legend>
527 <input type="hidden" name="op" value="add" />
529 <legend>Edit list <i>[% shelf.shelfname | html %]</i></legend>
530 <input type="hidden" name="op" value="edit" />
532 <input type="hidden" name="referer" value="[% referer | html %]" />
533 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" />
536 <label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelf.shelfname |html %]" required="required" class="required" />
537 <span class="required">Required</span>
540 <span class="label">Owner: </span>
541 [% IF op == 'add_form' %]
542 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber %]" />[% loggedinusername %]</li>
545 <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber %]" />[% owner.firstname _ ' ' _ owner.surname %]
547 <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber %]" />[% loggedinusername %]
551 <li><label for="sortfield" >Sort this list by: </label>
552 <select name="sortfield">
553 [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
554 [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
555 [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
556 [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
558 <li><label for="category">Category: </label>
559 <select id="category" name="category">
560 [% IF shelf.is_private %]
561 <option value="1" selected="selected">Private</option>
563 <option value="1">Private</option>
565 [% IF shelf.is_public %]
566 <option value="2" selected="selected">Public</option>
568 <option value="2">Public</option>
572 [% INCLUDE list_permissions %]
577 <fieldset class="action">
578 <input type="submit" value="Save" class="submit" />
579 [% IF referer == 'view' %]
580 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]" class="cancel">Cancel</a>
582 [% IF category == PUBLIC %]
583 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC %]" class="cancel">Cancel</a>
585 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE %]" class="cancel">Cancel</a>
592 <div class="help"><ul>
593 <li><b>Private list:</b> Is managed by you and can be seen only by you.</li>
594 <li><b>Public list:</b> Can be seen by everybody, but managed only by you.</li>
601 [% IF op == 'list' %]
603 <div id="tabs" class="toptabs">
605 <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
606 <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
609 <div id="tab_content">
610 <table id="listresultst">
613 <th class="NoVisible">Type</th>
618 <th>Creation date</th>
619 <th>Modification date</th>
622 <tr class="filters_row">
624 <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
626 <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
628 <select class="filter text_filter" id="searchsortby_filter">
629 <option value=""></option>
630 <option value="title">Title</option>
631 <option value="author">Author</option>
632 <option value="copyrightdate">Copyrightdate</option>
633 <option value="itemcallnumber">Call number</option>
647 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
648 <!-- Value will be set here by placeHold() -->
649 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
650 <input type="hidden" name="multi_hold" value="1"/>
656 [% IF ( can_add_biblios ) %]
658 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
659 <fieldset class="brief noprint">
660 <legend>Add items</legend>
663 <label for="barcodes">Barcodes:</label>
664 <textarea name="barcodes" id="barcodes" class="focus" autocomplete="off" rows="5"></textarea>
665 <input type="hidden" name="op" value="add_biblio" />
666 <input type="hidden" name="referer" value="view" />
667 <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" />
670 <fieldset class="action">
671 <input type="submit" value="Add" />
679 [% INCLUDE 'intranet-bottom.inc' %]