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