Bug 7720: add options for controlling display of an item's home and/or holdings location
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-shelves.tt
1 [% USE Koha %]
2 [% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
3 [% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
4 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›   [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]Your lists[% END %][% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6 <script type="text/javascript">
7 //<![CDATA[
8 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
9 var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?");
10 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
11 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?");
12
13 [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
14 function holdSelections() {
15     var checkedBoxes = $("input:checkbox:checked");
16     if ($(checkedBoxes).size() == 0) {
17         alert(MSG_NO_RECORD_SELECTED);
18     } else {
19         var bibs = "";
20         $(checkedBoxes).each(function(){
21             var name = $(this).attr("name");
22             bib = name.substr(4);
23             bibs += bib + "/";
24         });
25         document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
26     }
27 }
28 [% END %][% END %]
29 [% IF ( TagsInputEnabled && loggedinusername ) %]
30 function tagSelected() {
31     var checkedBoxes = $("input:checkbox:checked");
32     if ($(checkedBoxes).size()) {
33         $("#tagsel_tag").hide();
34         $(".tag_hides").hide();
35         $("#tagsel_form").show();
36     } else {
37         alert(MSG_NO_RECORD_SELECTED);
38     }
39 }
40
41 function tagCanceled() {
42     $("#tagsel_form").hide();
43     $("#tagsel_tag").show();
44     $(".tag_hides").show();
45     $("#tagsel_new").val("");
46     $(".tagstatus").empty().hide();
47 }
48
49 function tagAdded() {
50     var checkedBoxes = $("input:checkbox:checked");
51     if (!$(checkedBoxes).size()) {
52         alert(MSG_NO_RECORD_SELECTED);
53         return false;
54     }
55
56     var tag = $("#tagsel_new").val();
57     if (!tag || (tag == "")) {
58         alert(MSG_NO_TAG_SPECIFIED);
59         return false;
60     }
61
62     var bibs = [];
63     for (var i = 0; i < $(checkedBoxes).size(); i++) {
64         var box = $(checkedBoxes).get(i);
65         bibs[i] = $(box).val();
66     }
67
68     KOHA.Tags.add_multitags_button(bibs, tag);
69     return false;
70 }[% END %]
71
72 function enableCheckboxActions(){
73     // Enable/disable controls if checkboxes are checked
74     var checkedBoxes = $(".checkboxed input:checkbox:checked");
75     if ($(checkedBoxes).size()) {
76       $("#selections").html(_("With selected titles: "));
77       $("#selections-toolbar .links a").removeClass("disabled");
78     } else {
79       $("#selections").html(_("Select titles to: "));
80       $("#selections-toolbar .links a").addClass("disabled");
81     }
82 }
83
84 $(function() {
85     [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
86     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
87     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
88   $("a.print").show();
89
90     [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]$("#placehold").html("<a href=\"#\" class=\"hold tag_hides disabled\">"+_("Place hold")+"<\/a>");
91       $("#selections-toolbar a.hold").click(function(){
92          holdSelections();
93          return false;
94       });[% END %][% END %]
95
96     $("#CheckAll").click(function(){
97         $(".checkboxed").checkCheckboxes();
98         enableCheckboxActions();
99         return false;
100     });
101     $("#CheckNone").click(function(){
102         $(".checkboxed").unCheckCheckboxes();
103         enableCheckboxActions();
104         return false;
105     });
106
107     $(".cb").click(function(){
108       enableCheckboxActions();
109     });
110     enableCheckboxActions();
111
112 [% IF ( TagsInputEnabled && loggedinusername ) %]
113         $("#tagsel_tag").click(function(){
114             tagSelected();
115             return false;
116         });
117         $("#tagsel_cancel").click(function(){
118             tagCanceled();
119             return false;
120         });
121         $("#tagsel_button").click(function(){
122             tagAdded();
123             return false;
124         });
125
126         $(".tag_add").click(function(){
127             var thisid = $(this).attr("id");
128             thisid = thisid.replace("tag_add","");
129             $(this).hide();
130             $("#tagform"+thisid).show();
131             $("#newtag"+thisid).focus();
132             $("#newtag"+thisid+"_status").empty().hide();
133             return false;
134         });
135         $(".cancel_tag_add").click(function(){
136             var thisid = $(this).attr("id");
137             thisid = thisid.replace("cancel","");
138             $("#tagform"+thisid).hide();
139             $("#tag_add"+thisid).show();
140             $("#newtag"+thisid).val("");
141             $("#newtag"+thisid+"_status").empty().hide();
142             return false;
143         });
144         $(".tagbutton").click(function(){
145           var thisid = $(this).attr("title");
146           var tag = $("#newtag"+thisid).val();
147           if (!tag || (tag == "")) {
148               alert(MSG_NO_TAG_SPECIFIED);
149               return false;
150           }
151           KOHA.Tags.add_tag_button(thisid, tag);
152           return false;
153         });
154 [% END %]
155   [% IF ( loggedinusername && allowremovingitems ) %]
156   var removeFromListLinks = $(".removefromlist");
157   removeFromListLinks.show();
158   // "remove from list" appearing on each line of the list output
159   removeFromListLinks.on("click",function(){
160       $(".checkboxed").unCheckCheckboxes();
161       var listitem = $("input[name="+this.id+"]");
162       listitem.prop("checked",true);
163       $("#myform").submit();
164   });
165   $("#myform").submit(function(){
166     var checkedBoxes = $(".checkboxed input:checkbox:checked");
167     var numchecked = $(checkedBoxes).size();
168     if (numchecked) {
169         if( numchecked > 1 ){
170             return confirmDelete(MSG_REMOVE_FROM_LIST);
171         } else {
172             return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
173         }
174     } else {
175       alert(MSG_NO_RECORD_SELECTED);
176       return false;
177     }
178   });
179     $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Remove from list")+"</a>")
180     .click(function(){
181       $("#myform").submit();
182       return false;
183     });
184   [% END %]
185     [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
186     [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
187   [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
188 });
189       function Check(f) {
190                 var _alertString="";
191                 var alertString2;
192
193             if(f.addshelf.value.length ==0){
194         _alertString += _("- You must enter a list name") + "\n";
195                 }
196
197                 if (_alertString.length==0) {
198                         f.submit();
199                 } else {
200                         alertString2 = _("Form not submitted because of the following problem(s)");
201                         alertString2 += "\n------------------------------------------------------------------------------------\n\n";
202                         alertString2 += _alertString;
203                         alert(alertString2);
204                 }
205         }
206
207 $(document).ready(function() {
208   $('#sort-submit').hide();
209 });
210
211 //]]>
212 </script>
213 </head>
214 [% IF ( loggedinusername ) %]<body id="opac-userlists">[% ELSE %]<body id="opac-lists">[% END %]
215
216 [% BLOCK list_permissions %]
217     <li>
218         <label for="allow_add">Permissions: </label>
219         <select name="allow_add" id="allow_add">
220             [% IF allow_add %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
221             [% IF allow_add %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
222         </select>
223         &nbsp;<span>anyone else to add entries. (The owner of a list is always allowed to add entries, but needs permission to remove.)</span>
224     </li>
225     <li>
226         <label>&nbsp;</label>
227         <select name="allow_delete_own" id="allow_delete_own">
228             [% IF allow_delete_own %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
229             [% IF allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
230         </select>
231         &nbsp;<span>anyone to remove his own contributed entries.</span>
232     </li>
233     <li>
234         <label>&nbsp;</label>
235         <select name="allow_delete_other" id="allow_delete_other">
236             [% IF allow_delete_other %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
237             [% IF allow_delete_other %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
238         </select>
239         &nbsp;<span>anyone to remove other contributed entries.</span>
240     </li>
241 [% END %]
242
243 [%# When using the next block, add the parameter for shelfnumber and add a tag to end the form %]
244 [% BLOCK remove_share %]
245     <form action="opac-shelves.pl" method="post">
246         <input type="hidden" name="shelves" value="1" />
247         <input type="hidden" name="display" value="privateshelves" />
248         <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
249         <input type="submit" class="removeshare" onclick="return confirmDelete(MSG_CONFIRM_REMOVE_SHARE);" value="Remove share" />
250 [% END %]
251
252 [% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSIF ( loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
253     <div id="bd">
254       [% INCLUDE 'masthead.inc' %]
255       <div id="yui-main">
256         <div class="yui-b">
257           <div id="usershelves" class="container">
258           
259             [% IF ( paramsloop ) %]
260               [% FOREACH paramsloo IN paramsloop %]
261                 <div class="yui-ge">
262                   <div class="yui-u first">
263                     [% IF ( paramsloo.already ) %]<div class="dialog alert">A list named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
264                     [% IF ( paramsloo.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</div>[% END %]
265                     [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
266                     [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %]
267                     [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %]
268                     [% IF ( paramsloo.need_confirm ) %]
269                       <div class="dialog alert">
270                         The list <i>[% paramsloo.need_confirm %]</i> is not empty.
271                         <br />It has <b>[% paramsloo.count %]</b> [% IF ( paramsloo.single ) %]entry[% ELSE %]entries[% END %].
272                         <br />Use the "Confirm" button below to confirm deletion.
273                      </div>
274                     [% END %]
275                     [% IF ( paramsloo.nopermission ) %]
276                       <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission |html%].</div>
277                     [% END %]
278                     [% IF ( paramsloo.failgetitem ) %]
279                       <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
280                     [% END %]
281                     [% IF ( paramsloo.duplicatebiblio ) %]
282                       <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
283                     [% END %]
284                     [% IF ( paramsloo.delete_ok ) %]
285                       <div class="dialog message">List [% paramsloo.delete_ok %] Deleted.</div>
286                     [% END %]
287                     [% IF ( paramsloo.delete_fail ) %]
288                       <div class="dialog message">ERROR: Database error. Delete (list number [% paramsloo.delete_fail %]) failed.</div>
289                     [% END %]
290                     [% IF ( paramsloo.unrecognized ) %]
291                       <div class="dialog message">ERROR: List number [% paramsloo.unrecognized %] unrecognized.</div>
292                     [% END %]
293                     [% IF ( paramsloo.modifyfailure) %]
294                       <div class="dialog message">ERROR: Shelf could not be renamed to [% paramsloo.modifyfailure %]. This name may not be unique for this type of list. Please check.</div>
295                     [% END %]
296                     [% IF ( paramsloo.nothingdeleted) %]
297                       <div class="dialog message">Warning: You could not delete any selected items from this shelf.</div>
298                     [% END %]
299                     [% IF ( paramsloo.somedeleted) %]
300                       <div class="dialog message">Warning: You could not delete all selected items from this shelf.</div>
301                     [% END %]
302                   </div>
303                 </div>
304               [% END %]<!-- /paramsloop -->
305             [% END %] <!-- /paramsloop -->
306
307             <div class="yui-g">
308
309             [% IF ( viewshelf ) %]<!--  Viewing a particular shelf -->
310               <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> &#8674; <em>[% shelfname |html %]</em></h3>
311               [% IF ( itemsloop ) %]
312                   <div id="toolbar" class="list-actions">
313
314                       <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download" onclick="open(CGIBIN+'opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download list</a>
315
316 [% IF ( opacuserlogin ) %]<span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>[% END %]
317
318 <a class="print" href="opac-shelves.pl" onclick="print(); return false;">Print list</a>
319
320 <form action="/cgi-bin/koha/opac-shelves.pl" id="sorting-form">
321     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
322
323     <label for="sort">Sort by: </label>
324     <select name="sort" onchange="$('#sorting-form').submit()">
325         <option value="">Default sorting</option>
326
327         [% IF sort == 'author' %]
328             <option value="author" selected="selected">Author</option>
329         [% ELSE %]
330             <option value="author">Author</option>
331         [% END %]
332
333         [% IF sort == 'title' %]
334             <option value="title" selected="selected">Title</option>
335         [% ELSE %]
336             <option value="title">Title</option>
337         [% END %]
338
339         [% IF sort == 'itemcallnumber' %]
340             <option value="itemcallnumber" selected="selected">Call number</option>
341         [% ELSE %]
342             <option value="itemcallnumber">Call number</option>
343         [% END %]
344
345         [% IF sort == 'copyrightdate' %]
346             <option value="copyrightdate" selected="selected">Copyright date</option>
347         [% ELSE %]
348             <option value="copyrightdate">Copyright date</option>
349         [% END %]
350     </select>
351
352     <select name="direction" onchange="$('#sorting-form').submit()">
353         [% IF direction == 'asc' %]
354             <option value="asc" selected="selected">Ascending</option>
355         [% ELSE %]
356             <option value="asc">Ascending</option>
357         [% END %]
358
359         [% IF direction == 'desc' %]
360             <option value="desc" selected="selected">Descending</option>
361         [% ELSE %]
362             <option value="desc">Descending</option>
363         [% END %]
364     </select>
365
366     <input type="submit" id="sort-submit" value="Resort list" />
367 </form>
368
369                 [% IF ( manageshelf ) %] <span class="sep">|</span> <form method="get" action="opac-shelves.pl"><input type="hidden" name="op" value="modif" />
370                 <input type="hidden" name="display" value="viewshelf" />
371                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf" value="Edit list" /></form>
372
373                       <form method="post" action="opac-shelves.pl">
374                         <input type="hidden" value="1" name="shelves"/>
375                          <input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
376                          [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves"/>[% END %]<input type="submit" class="deleteshelf" value="Delete list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
377                       </form>
378                     [% IF showprivateshelves && Koha.Preference('OpacAllowSharingPrivateLists') %]
379                         <form action="opac-shareshelf.pl" method="post">
380                             <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
381                             <input type="hidden" name="op" value="invite" />
382                             <input type="submit" class="Share" value="Share" />
383                         </form>
384                     [% END %]
385                 [% ELSIF showprivateshelves %]
386                     [% INCLUDE remove_share %]
387                     <input type="hidden" name="REMSHR-[% shelfnumber %]" value="1" />
388                     </form>
389                 [% END %]
390
391
392                   </div>
393                   <div id="selections-toolbar" class="list-actions">
394                   <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
395                   <span class="links"><span id="selections">Select titles to: </span>
396                                       [% IF ( RequestOnOpac ) %]
397                                         <span id="placehold"></span>
398                                       [% END %]
399                                       [% IF ( TagsInputEnabled && loggedinusername ) %]
400                                         <span id="addtags">
401                                           <a id="tagsel_tag" href="#" class="disabled">Tag</a>
402                                         </span>
403                                         <span id="tagsel_form" style="display:none">
404                                           <label for="tagsel_new">New tag:</label>
405                                           <input name="tagsel_new" id="tagsel_new" maxlength="100" />
406                                           <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" />
407                                           <a href="#" id="tagsel_cancel">Cancel</a>
408                                         </span>
409                                       [% END %]
410                     [% IF ( loggedinusername && allowremovingitems ) %]<span id="removeitems"></span>[% END %]</span>
411                   </div>
412                   <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
413                 [% IF ( manageshelf ) %]
414                     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
415                     <input type="hidden" name="modifyshelfcontents" value="1" />
416                 [% END %]
417                 <div class="searchresults">
418                 <table id="listcontents">
419                   <tbody>
420                   [% FOREACH itemsloo IN itemsloop %]
421                     [% UNLESS ( loop.odd ) %]
422                       <tr class="highlight">
423                     [% ELSE %]
424                       <tr>
425                     [% END %]
426                         <td><input type="checkbox" class="cb" name="REM-[% itemsloo.biblionumber %]"
427                                    value="[% itemsloo.biblionumber %]" /></td>
428                     [% UNLESS ( item_level_itypes ) %]
429                         <td>
430                           [% UNLESS ( noItemTypeImages ) %]
431                           <img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
432                           [% END %]
433                           [% itemsloo.description %]
434                         </td>
435                     [% END %]
436                         <td>
437                         [% IF ( itemsloo.XSLTBloc ) %]
438                          [% itemsloo.XSLTBloc %]
439                         [% ELSE %]
440
441                                 [% IF ( itemsloo.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
442                                 [% ELSE %]
443                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
444                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
445                                 [% END %]
446                                 [% END %]
447                 [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield|html %][% END %]</a>
448                                 [% IF ( itemsloo.author ) %]by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% itemsloo.author |url %]" title="Search for works by this author" class="author">[% itemsloo.author %]</a>
449
450                                 [% ELSE %]&nbsp;
451                                 [% END %]
452         <span class="results_summary"><span class="label">Publication:</span>
453                         [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode|html %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %]
454                     [% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %]
455                         [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
456                         [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %]
457                         [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
458                 </span>
459                 <span class="results_summary"><span class="label">Holdings:</span>[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
460           [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
461           [% IF ( ITEM_RESULT.itemcallnumber ) %]
462         ([% ITEM_RESULT.itemcallnumber %])[% IF ( loop.last ) %].[% ELSE %],[% END %]
463           [% END %]
464           [% END %][% ELSE %]This record has no items.[% END %]</span>
465             [% END %]
466           [% IF ( TagsShowEnabled ) %]
467             [% IF ( itemsloo.TagLoop.size ) %]
468               <div class="results_summary">
469               <span class="label">Tags:</span>
470               <ul style="display: inline; list-style: none;">[% FOREACH TagLoo IN itemsloo.TagLoop %]<li style="display: inline; list-style: none;"><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a> <span class="weight">([% TagLoo.weight_total %])</span></li>
471                   [% END %]
472               </ul>
473               </div>
474             [% END %]
475           [% END %]
476
477     <span class="results_summary actions">
478         <span class="label">Actions:</span>
479
480         [% IF ( TagsInputEnabled ) %]
481               [% IF ( loggedinusername ) %]
482                     <a class="tag_add" id="tag_add[% itemsloo.biblionumber %]" href="#">Add tag</a>
483                     <span id="tagform[% itemsloo.biblionumber %]" class="tag_results_input" style="display:none;">
484                         <label for="newtag[% itemsloo.biblionumber %]">New tag(s):</label>
485                         <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
486                         <input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
487                         <a class="cancel_tag_add" id="cancel[% itemsloo.biblionumber %]" href="#">(done)</a>
488                     </span>
489                     <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
490                         Tag status here.
491                     </span>
492               [% ELSIF ( loop.first ) %]
493                     <span class="tagstatus" id="login4tags">Log in to add tags.</span>
494               [% END %]
495           [% END %]
496
497       [% IF ( RequestOnOpac ) %]
498           [% UNLESS ( itemsloo.norequests ) %]
499             [% IF ( opacuserlogin ) %]
500               [% IF ( AllowOnShelfHolds ) %]
501                 <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
502               [% ELSE %]
503                 [% IF ( itemsloo.itemsissued ) %]
504                   <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
505                 [% END %]
506               [% END %]
507             [% END %]
508           [% END %]
509         [% END %]
510
511         [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a>
512           [% END %][% END %][% END %]
513
514         [% IF ( allowremovingitems ) %]
515             <a class="removefromlist" id="REM-[% itemsloo.biblionumber %]" href="#">Remove from this list</a>
516         [% END %]
517
518           [% IF ( opacbookbag ) %]
519               [% IF ( itemsloo.incart ) %]
520                   <a class="addtocart cart[% itemsloo.biblionumber %]" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">In your cart</a> <a class="cartRemove cartR[% itemsloo.biblionumber %]" href="#" onclick="delSingleRecord('[% itemsloo.biblionumber %]'); return false;">(remove)</a>
521               [% ELSE %]
522                   <a class="addtocart cart[% itemsloo.biblionumber %]" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">Add to cart</a> <a style="display:none;" class="cartRemove cartR[% itemsloo.biblionumber %]" href="#" onclick="delSingleRecord('[% itemsloo.biblionumber %]'); return false;">(remove)</a>
523               [% END %]
524           [% END %]
525         </span>
526
527                           <!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
528                         </td>
529           <td>
530           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
531             [% IF ( OPACLocalCoverImages ) %]<span title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
532                     [% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<span title="[% SEARCH_RESULT.biblionumber %]" id="amazon-thumbnail[% loop.count %]"><img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" /></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
533
534           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
535                 <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" /></span>
536                 [% ELSE %]
537                 <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="http://www.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" /></span>[% END %][% END %][% END %]
538
539                 [% IF ( GoogleJackets ) %][% IF ( itemsloo.normalized_isbn ) %]<div style="block" title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
540                 [% IF OpenLibraryCovers %][% IF itemsloo.normalized_isbn %]<span style="block" title="[% itemsloo.biblionumber %]" class="[% itemsloo.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
541                 </a>
542                 [% IF ( BakerTaylorEnabled ) %][% IF ( itemsloo.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% itemsloo.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% itemsloo.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
543         </td>
544                       </tr>
545                   [% END %]<!-- /itemsloop -->
546                     </tbody>
547                   </table>
548                   </div>
549                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
550                 [% ELSE %]
551                   <div class="dialog message">This list is empty.  [% IF ( opacuserlogin ) %]You can add to your lists from the results of any <a href="opac-main.pl">search</a>![% END %]</div>
552               [% END %]<!-- /itemsloop -->
553             [% END %]<!-- /viewshelf -->
554
555
556             [% IF ( itemsloop && allowremovingitems ) %]
557                 <form method="post" action="opac-shelves.pl">
558                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
559                 <input type="hidden" name="modifyshelfcontents" value="1" />
560                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove selected items" class="icon delete"/>
561                 </form>
562             [% ELSIF ( !itemsloop && manageshelf ) %]
563                 <form method="post" action="opac-shelves.pl">
564                   <input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
565                   <input type="hidden" name="shelves" value="1" />
566                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
567                   <input type="submit" class="icon delete" value="Delete this list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
568                 </form>
569             [% END %]
570
571             
572             [% IF ( edit ) %]
573                 <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> &#8674; <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]"><em>[% shelfname |html %]</em></a> &#8674; Editing</h3>
574                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
575                   <input type="hidden" name="op" value="modifsave" />
576                   <input type="hidden" name="display" value="[% display %]" />
577                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
578                   <fieldset class="rows">
579                     <ol>
580                       <li><label for="shelfname">List name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
581                       <li>
582                         <label for="sortfield" >Sort this list by: </label>
583                         <select name="sortfield" id="sortfield">
584                           [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
585                           [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
586                           [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Year</option>[% ELSE %]<option value="copyrightdate">Year</option>[% END %]
587                           [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
588                         </select>
589                       </li>
590                       [% IF ( OpacAllowPublicListCreation || category2 ) %]
591                       <li>
592                         <label for="category">Category:</label>
593                         <select name="category" id="category">
594                           [% IF ( category1 ) %]<option value="1" selected="selected">Private</option>[% ELSE %]<option value="1">Private</option>[% END %]
595                           [% IF ( category2 ) %]<option value="2" selected="selected">Public</option>[% ELSE %]<option value="2">Public</option>[% END %]
596                         </select>
597                           [% IF ( category2 && !OpacAllowPublicListCreation ) %]
598                               The library has disabled the ability for patrons to create new public lists.  If you make your list private, you will not be able to make it public again.
599                           [% END %]
600                       </li>
601                       [% INCLUDE list_permissions %]
602                       [% END %]
603                     </ol>
604                     [% UNLESS ( OpacAllowPublicListCreation || category2 ) %]
605                         <input type="hidden" name="category" value="1" />
606                     [% END %]
607                   </fieldset>
608                   <fieldset class="action"><input type="submit" value="Save" class="submit" /> [% IF ( showprivateshelves ) %]<a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber %]&amp;display=privateshelves">Cancel</a>[% ELSE %]<a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber %]">Cancel</a>[% END %]</fieldset>
609                 </form>
610             [% END %]<!-- /edit -->
611
612
613             [% UNLESS ( edit ) %]
614               [% UNLESS ( viewshelf ) %]
615                 [% UNLESS ( shelves ) %]
616                   <h2>Lists</h2>
617                   <ul class="link-tabs">
618                   [% IF ( opacuserlogin ) %]
619                   [% IF ( showprivateshelves ) %]
620                     <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
621                   [% ELSE %]
622                     <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
623                   [% END %]
624                   [% END %]
625                   [% IF ( showpublicshelves ) %]
626                     <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
627                   [% ELSE %]
628                     <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
629                   [% END %]
630                   </ul>
631                   
632                   [% IF ( showprivateshelves ) %]
633                     <div id="privateshelves" class="tab-container" style="display:block;">
634                   [% ELSE %]
635                     <div id="privateshelves" class="tab-container" style="display:none;">
636                   [% END %]
637         
638                   [% IF ( loggedinusername ) %]
639                     <div id="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a></div>
640                   [% IF ( showprivateshelves ) %]
641                     [% IF ( shelveslooppriv ) %]
642                       <table>
643                         <tr>
644                           <th>List name</th>
645                           <th>Contents</th>
646                           <th>Type</th>
647                           <th>Options</th>
648                         </tr>
649                         [% FOREACH shelveslooppri IN shelveslooppriv %]
650                           [% UNLESS ( loop.odd ) %]
651                             <tr class="highlight">
652                           [% ELSE %]
653                             <tr>
654                           [% END %]
655                               <td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
656                               <td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
657                               <td>
658                                 [% IF ( shelveslooppri.viewcategory1 ) %][% IF !shelveslooppri.shares %]Private[% ELSE %]Shared[% END %][% END %]
659                                 [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
660                               </td>
661                               <td>
662                               [% IF ( shelveslooppri.mine ) %]
663                                 <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
664                                   <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
665                                   <input type="hidden" name="display" value="privateshelves" />
666                                   <input type="hidden" name="op" value="modif" />
667                                   <input type="submit" class="editshelf" value="Edit" />
668                                 </form>
669                                 <form action="opac-shelves.pl" method="post">
670                                   <input type="hidden" name="shelves" value="1" />
671                                   <input type="hidden" name="display" value="privateshelves" />
672                                   <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
673                                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
674                               [% IF ( shelveslooppri.confirm ) %]
675                                     <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
676                                     <input type="submit" class="confirm" value="Confirm" />
677                               [% ELSE %]
678                                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
679                               [% END %]
680                               </form>
681                               [% IF Koha.Preference('OpacAllowSharingPrivateLists') %]
682                                 <form action="opac-shareshelf.pl" method="post">
683                                   <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
684                                   <input type="hidden" name="op" value="invite" />
685                                   <input type="submit" class="Share" value="Share" />
686                                 </form>
687                               [% END %]
688                             [% ELSIF shelveslooppri.shares %]
689                                 [% INCLUDE remove_share %]
690                                 <input type="hidden" name="REMSHR-[% shelveslooppri.shelf %]" value="1" />
691                                 </form>
692                             [% END %]&nbsp;
693                             </td>
694                           </tr>
695                         [% END %]
696                       </table>
697                       <div class="pages">[% pagination_bar %]</div>
698                     [% ELSE %]
699                          <p>No private lists.</p>
700                     [% END %]<!-- /shelveslooppriv -->
701                   [% END %]<!-- /showprivateshelves -->
702                   [% ELSE %]<!-- /loggedinusername -->
703                       [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new lists.</div>[% END %]
704                   [% END %]<!-- /loggedinusername -->
705
706                   
707                             </div><!-- /privateshelves -->
708
709                   [% IF ( showpublicshelves ) %]
710                     <div id="publicshelves" class="tab-container" style="display:block;">
711                   [% ELSE %]
712                     <div id="publicshelves" class="tab-container" style="display:none;">
713                   [% END %]
714                   [% IF ( loggedinusername ) %]
715                  <div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a></div>
716                   [% ELSE %]
717                   [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new lists.</div>[% END %]
718                   [% END %]
719                   [% IF ( shelvesloop ) %]
720                       <table>
721                         <tr>
722                           <th>List name</th>
723                           <th>Contents</th>
724                           <th>Type</th>
725                           <th>Options</th>
726                         </tr>
727                     [% FOREACH shelvesloo IN shelvesloop %]
728                       [% UNLESS ( loop.odd ) %]
729                         <tr class="highlight">
730                       [% ELSE %]
731                         <tr>
732                       [% END %]
733                           <td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
734                           <td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
735                           <td>
736                             [% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
737                             [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
738                               </td>
739                           <td>
740                                                         [% IF ( shelvesloo.mine ) %]
741                               <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
742                                 <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
743                                 <input type="hidden" name="op" value="modif" />
744                                 <input type="hidden" name="display" value="publicshelves" />
745                                 <input type="submit" class="editshelf" value="Edit" />
746                               </form>
747                               <form action="opac-shelves.pl" method="post">
748                                 <input type="hidden" name="shelves" value="1" />
749                                 <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
750                                 [% IF ( shelvesloo.confirm ) %]
751                                   <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
752                                   <input type="submit" class="confirm" value="Confirm" />
753                                 [% ELSE %]
754                                   <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
755                                 [% END %]
756                               </form>
757                             [% END %]&nbsp;
758                           </td>
759                         </tr>
760                     [% END %]<!-- /shelvesloop -->
761                       </table>
762                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
763                   [% ELSE %]<!-- /shelvesloop -->
764                     [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
765                   [% END %]<!-- /shelvesloop -->
766                   
767                     </div><!-- /publicshelves -->
768                     
769                 [% END %]<!-- /shelves -->
770               [% END %]<!-- /viewshelf -->
771             [% END %]<!-- /edit -->
772
773             [% IF ( shelves ) %]
774               <div id="addshelf">
775                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
776                   <fieldset class="rows">
777                     <legend>Create a new list</legend>
778                     <input type="hidden" name="shelves" value="1" />
779                     <ol>
780                       <li>
781                         <label class="required" for="addshelf">List name:</label>
782                         [% IF ( already ) %]
783                           <input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
784                         [% ELSE %]
785                           <input id="addshelf" type="text" name="addshelf" size="60" />
786                         [% END %]
787                         <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
788                       </li>
789                       <li>
790                         <label for="sortfield" >Sort this list by: </label>
791                         <select name="sortfield" id="sortfield">
792                           <option value="title">Title</option>
793                           <option value="author">Author</option>
794                           <option value="copyrightdate">Year</option>
795                           <option value="itemcallnumber">Call number</option>
796                         </select>
797                       </li>
798                   [% IF (OpacAllowPublicListCreation) %]
799                       <li>
800                         <label for="category">Category:</label>
801                         <select name="category" id="category">
802                           <option value="1">Private</option>
803                           <option value="2">Public</option>
804                         </select>
805                       </li>
806                       [% INCLUDE list_permissions %]
807                   [% END %]
808                     </ol>
809                   [% UNLESS (OpacAllowPublicListCreation) %]
810                       <input type="hidden" name="category" value="1" />
811                   [% END %]
812                   </fieldset>
813                   <fieldset class="action">
814                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
815                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
816                   </fieldset>
817                 </form>
818               </div>
819             [% END %]<!-- /shelves -->
820
821             
822             </div>
823           </div>
824         </div>
825       </div>
826       [% IF ( OpacNav||loggedinusername ) %]
827         <div class="yui-b">
828           <div id="leftmenus" class="container">
829             [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
830           </div>
831         </div>
832       [% END %]
833     </div><!-- /bd -->
834
835 <!-- </div> -->
836 <!-- DEBUG -->
837     <div id="debug"></div>
838
839 [% INCLUDE 'opac-bottom.inc' %]