Bug 7257: Add a link to remove an individual title from a list in the OPAC
[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" 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_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?");
11 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
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="permissions">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 [% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSIF ( loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
244     <div id="bd">
245       [% INCLUDE 'masthead.inc' %]
246       <div id="yui-main">
247         <div class="yui-b">
248           <div id="usershelves" class="container">
249           
250             [% IF ( paramsloop ) %]
251               [% FOREACH paramsloo IN paramsloop %]
252                 <div class="yui-ge">
253                   <div class="yui-u first">
254                     [% IF ( paramsloo.already ) %]<div class="dialog alert">A list named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
255                     [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
256                     [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %]
257                     [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %]
258                     [% IF ( paramsloo.need_confirm ) %]
259                       <div class="dialog alert">
260                         The list <i>[% paramsloo.need_confirm %]</i> is not empty.
261                         <br />It has <b>[% paramsloo.count %]</b> [% IF ( paramsloo.single ) %]entry[% ELSE %]entries[% END %].
262                         <br />Use the "Confirm" button below to confirm deletion.
263                      </div>
264                     [% END %]
265                     [% IF ( paramsloo.nopermission ) %]
266                       <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission |html%].</div>
267                     [% END %]
268                     [% IF ( paramsloo.failgetitem ) %]
269                       <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
270                     [% END %]
271                     [% IF ( paramsloo.duplicatebiblio ) %]
272                       <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
273                     [% END %]
274                     [% IF ( paramsloo.delete_ok ) %]
275                       <div class="dialog message">List [% paramsloo.delete_ok %] Deleted.</div>
276                     [% END %]
277                     [% IF ( paramsloo.delete_fail ) %]
278                       <div class="dialog message">ERROR: Database error. Delete (list number [% paramsloo.delete_fail %]) failed.</div>
279                     [% END %]
280                     [% IF ( paramsloo.unrecognized ) %]
281                       <div class="dialog message">ERROR: List number [% paramsloo.unrecognized %] unrecognized.</div>
282                     [% END %]
283                     [% IF ( paramsloo.modifyfailure) %]
284                       <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>
285                     [% END %]
286                     [% IF ( paramsloo.nothingdeleted) %]
287                       <div class="dialog message">Warning: You could not delete any selected items from this shelf.</div>
288                     [% END %]
289                     [% IF ( paramsloo.somedeleted) %]
290                       <div class="dialog message">Warning: You could not delete all selected items from this shelf.</div>
291                     [% END %]
292                   </div>
293                 </div>
294               [% END %]<!-- /paramsloop -->
295             [% END %] <!-- /paramsloop -->
296
297             <div class="yui-g">
298
299             [% IF ( viewshelf ) %]<!--  Viewing a particular shelf -->
300               <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> &#8674; <em>[% shelfname |html %]</em></h3>
301               [% IF ( itemsloop ) %]
302                   <div id="toolbar" class="list-actions">
303
304                       <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>
305
306 [% 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 %]
307
308 <a class="print" href="opac-shelves.pl" onclick="print(); return false;">Print list</a>
309
310 <form action="/cgi-bin/koha/opac-shelves.pl" id="sorting-form">
311     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
312
313     <label for="sort">Sort by: </label>
314     <select name="sort" onchange="$('#sorting-form').submit()">
315         <option value="">Default sorting</option>
316
317         [% IF sort == 'author' %]
318             <option value="author" selected="selected">Author</option>
319         [% ELSE %]
320             <option value="author">Author</option>
321         [% END %]
322
323         [% IF sort == 'title' %]
324             <option value="title" selected="selected">Title</option>
325         [% ELSE %]
326             <option value="title">Title</option>
327         [% END %]
328
329         [% IF sort == 'itemcallnumber' %]
330             <option value="itemcallnumber" selected="selected">Call number</option>
331         [% ELSE %]
332             <option value="itemcallnumber">Call number</option>
333         [% END %]
334
335         [% IF sort == 'copyrightdate' %]
336             <option value="copyrightdate" selected="selected">Copyright date</option>
337         [% ELSE %]
338             <option value="copyrightdate">Copyright date</option>
339         [% END %]
340     </select>
341
342     <select name="direction" onchange="$('#sorting-form').submit()">
343         [% IF direction == 'asc' %]
344             <option value="asc" selected="selected">Ascending</option>
345         [% ELSE %]
346             <option value="asc">Ascending</option>
347         [% END %]
348
349         [% IF direction == 'desc' %]
350             <option value="desc" selected="selected">Descending</option>
351         [% ELSE %]
352             <option value="desc">Descending</option>
353         [% END %]
354     </select>
355
356     <input type="submit" id="sort-submit" value="Resort list" />
357 </form>
358
359                 [% IF ( manageshelf ) %] <span class="sep">|</span> <form method="get" action="opac-shelves.pl"><input type="hidden" name="op" value="modif" />
360                 <input type="hidden" name="display" value="viewshelf" />
361                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf" value="Edit list" /></form>
362
363                       <form method="post" action="opac-shelves.pl">
364                         <input type="hidden" value="1" name="shelves"/>
365                          <input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
366                          [% 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);"/>
367                       </form> [% END %]
368
369
370                   </div>
371                   <div id="selections-toolbar" class="list-actions">
372                   <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
373                   <span class="links"><span id="selections">Select titles to: </span>
374                                       [% IF ( RequestOnOpac ) %]
375                                         <span id="placehold"></span>
376                                       [% END %]
377                                       [% IF ( TagsInputEnabled && loggedinusername ) %]
378                                         <span id="addtags">
379                                           <a id="tagsel_tag" href="#" class="disabled">Tag</a>
380                                         </span>
381                                         <span id="tagsel_form" style="display:none">
382                                           <label for="tagsel_new">New tag:</label>
383                                           <input name="tagsel_new" id="tagsel_new" maxlength="100" />
384                                           <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" />
385                                           <a href="#" id="tagsel_cancel">Cancel</a>
386                                         </span>
387                                       [% END %]
388                     [% IF ( loggedinusername && allowremovingitems ) %]<span id="removeitems"></span>[% END %]</span>
389                   </div>
390                   <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
391                 [% IF ( manageshelf ) %]
392                     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
393                     <input type="hidden" name="modifyshelfcontents" value="1" />
394                 [% END %]
395                 <div class="searchresults">
396                 <table id="listcontents">
397                   <tbody>
398                   [% FOREACH itemsloo IN itemsloop %]
399                     [% UNLESS ( loop.odd ) %]
400                       <tr class="highlight">
401                     [% ELSE %]
402                       <tr>
403                     [% END %]
404                         <td><input type="checkbox" class="cb" name="REM-[% itemsloo.biblionumber %]"
405                                    value="[% itemsloo.biblionumber %]" /></td>
406                     [% UNLESS ( item_level_itypes ) %]
407                         <td>
408                           [% UNLESS ( noItemTypeImages ) %]
409                           <img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
410                           [% END %]
411                           [% itemsloo.description %]
412                         </td>
413                     [% END %]
414                         <td>
415                         [% IF ( itemsloo.XSLTBloc ) %]
416                          [% itemsloo.XSLTBloc %]
417                         [% ELSE %]
418
419                                 [% IF ( itemsloo.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
420                                 [% ELSE %]
421                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
422                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
423                                 [% END %]
424                                 [% END %]
425                 [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield|html %][% END %]</a>
426                                 [% 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>
427
428                                 [% ELSE %]&nbsp;
429                                 [% END %]
430         <span class="results_summary"><span class="label">Publication:</span>
431                         [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode|html %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %]
432                     [% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %]
433                         [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
434                         [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %]
435                         [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
436                 </span>
437                 <span class="results_summary"><span class="label">Holdings:</span>[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
438           [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
439           [% IF ( ITEM_RESULT.itemcallnumber ) %]
440         ([% ITEM_RESULT.itemcallnumber %])[% IF ( loop.last ) %].[% ELSE %],[% END %]
441           [% END %]
442           [% END %][% ELSE %]This record has no items.[% END %]</span>
443             [% END %]
444           [% IF ( TagsShowEnabled ) %]
445             [% IF ( itemsloo.TagLoop.size ) %]
446               <div class="results_summary">
447               <span class="label">Tags:</span>
448               <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>
449                   [% END %]
450               </ul>
451               </div>
452             [% END %]
453           [% END %]
454
455     <span class="results_summary actions">
456         <span class="label">Actions:</span>
457
458         [% IF ( TagsInputEnabled ) %]
459               [% IF ( loggedinusername ) %]
460                     <a class="tag_add" id="tag_add[% itemsloo.biblionumber %]" href="#">Add tag</a>
461                     <span id="tagform[% itemsloo.biblionumber %]" class="tag_results_input" style="display:none;">
462                         <label for="newtag[% itemsloo.biblionumber %]">New tag(s):</label>
463                         <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
464                         <input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
465                         <a class="cancel_tag_add" id="cancel[% itemsloo.biblionumber %]" href="#">(done)</a>
466                     </span>
467                     <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
468                         Tag status here.
469                     </span>
470               [% ELSIF ( loop.first ) %]
471                     <span class="tagstatus" id="login4tags">Log in to add tags.</span>
472               [% END %]
473           [% END %]
474
475       [% IF ( RequestOnOpac ) %]
476           [% UNLESS ( itemsloo.norequests ) %]
477             [% IF ( opacuserlogin ) %]
478               [% IF ( AllowOnShelfHolds ) %]
479                 <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
480               [% ELSE %]
481                 [% IF ( itemsloo.itemsissued ) %]
482                   <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
483                 [% END %]
484               [% END %]
485             [% END %]
486           [% END %]
487         [% END %]
488
489         [% 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>
490           [% END %][% END %][% END %]
491
492         [% IF ( allowremovingitems ) %]
493             <a class="removefromlist" id="REM-[% itemsloo.biblionumber %]" href="#">Remove from this list</a>
494         [% END %]
495
496           [% IF ( opacbookbag ) %]
497               [% IF ( itemsloo.incart ) %]
498                   <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>
499               [% ELSE %]
500                   <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>
501               [% END %]
502           [% END %]
503         </span>
504
505                           <!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
506                         </td>
507           <td>
508           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
509             [% IF ( OPACLocalCoverImages ) %]<span title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
510                     [% 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 %]
511
512           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
513                 <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>
514                 [% ELSE %]
515                 <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 %]
516
517                 [% 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 %]
518                 [% 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 %]
519                 </a>
520                 [% 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 %]
521         </td>
522                       </tr>
523                   [% END %]<!-- /itemsloop -->
524                     </tbody>
525                   </table>
526                   </div>
527                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
528                 [% ELSE %]
529                   <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>
530               [% END %]<!-- /itemsloop -->
531             [% END %]<!-- /viewshelf -->
532
533
534             [% IF ( itemsloop && allowremovingitems ) %]
535                 <form method="post" action="opac-shelves.pl">
536                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
537                 <input type="hidden" name="modifyshelfcontents" value="1" />
538                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove selected items" class="icon delete"/>
539                 </form>
540             [% ELSIF ( !itemsloop && manageshelf ) %]
541                 <form method="post" action="opac-shelves.pl">
542                   <input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
543                   <input type="hidden" name="shelves" value="1" />
544                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
545                   <input type="submit" class="icon delete" value="Delete this list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
546                 </form>
547             [% END %]
548
549             
550             [% IF ( edit ) %]
551                 <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>
552                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
553                   <input type="hidden" name="op" value="modifsave" />
554                   <input type="hidden" name="display" value="[% display %]" />
555                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
556                   <fieldset class="rows">
557                     <ol>
558                       <li><label for="shelfname">List name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
559                       <li>
560                         <label for="sortfield" >Sort this list by: </label>
561                         <select name="sortfield" id="sortfield">
562                           [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
563                           [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
564                           [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Year</option>[% ELSE %]<option value="copyrightdate">Year</option>[% END %]
565                           [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
566                         </select>
567                       </li>
568                       <li>
569                         [% IF (OpacAllowPublicListCreation) %]
570                         <label for="category">Category:</label>
571                         <select name="category" id="category">
572                           [% IF ( category1 ) %]<option value="1" selected="selected">Private</option>[% ELSE %]<option value="1">Private</option>[% END %]
573                           [% IF ( category2 ) %]<option value="2" selected="selected">Public</option>[% ELSE %]<option value="2">Public</option>[% END %]
574                         </select>
575                         [% END %]
576                       </li>
577                       [% INCLUDE list_permissions %]
578                     </ol>
579                   </fieldset>
580                   <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>
581                 </form>
582             [% END %]<!-- /edit -->
583
584
585             [% UNLESS ( edit ) %]
586               [% UNLESS ( viewshelf ) %]
587                 [% UNLESS ( shelves ) %]
588                   <h2>Lists</h2>
589                   <ul class="link-tabs">
590                   [% IF ( opacuserlogin ) %]
591                   [% IF ( showprivateshelves ) %]
592                     <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
593                   [% ELSE %]
594                     <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
595                   [% END %]
596                   [% END %]
597                   [% IF ( showpublicshelves ) %]
598                     <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
599                   [% ELSE %]
600                     <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
601                   [% END %]
602                   </ul>
603                   
604                   [% IF ( showprivateshelves ) %]
605                     <div id="privateshelves" class="tab-container" style="display:block;">
606                   [% ELSE %]
607                     <div id="privateshelves" class="tab-container" style="display:none;">
608                   [% END %]
609         
610                   [% IF ( loggedinusername ) %]
611                     <div id="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a></div>
612                   [% IF ( showprivateshelves ) %]
613                     [% IF ( shelveslooppriv ) %]
614                       <table>
615                         <tr>
616                           <th>List name</th>
617                           <th>Contents</th>
618                           <th>Type</th>
619                           <th>&nbsp;</th>
620                         </tr>
621                         [% FOREACH shelveslooppri IN shelveslooppriv %]
622                           [% UNLESS ( loop.odd ) %]
623                             <tr class="highlight">
624                           [% ELSE %]
625                             <tr>
626                           [% END %]
627                               <td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
628                               <td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
629                               <td>
630                                 [% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
631                                 [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
632                               </td>
633                               <td>
634                               [% IF ( shelveslooppri.mine ) %]
635                                 <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
636                                   <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
637                                   <input type="hidden" name="display" value="privateshelves" />
638                                   <input type="hidden" name="op" value="modif" />
639                                   <input type="submit" class="editshelf" value="Edit" />
640                                 </form>
641                                 <form action="opac-shelves.pl" method="post">
642                                   <input type="hidden" name="shelves" value="1" />
643                                   <input type="hidden" name="display" value="privateshelves" />
644                                   <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
645                                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
646                               [% IF ( shelveslooppri.confirm ) %]
647                                     <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
648                                     <input type="submit" class="confirm" value="Confirm" />
649                               [% ELSE %]
650                                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
651                               [% END %]
652                                 </form>
653                             [% END %]&nbsp;
654                             </td>
655                           </tr>
656                         [% END %]
657                       </table>
658                       <div class="pages">[% pagination_bar %]</div>
659                     [% ELSE %]
660                          <p>No private lists.</p>
661                     [% END %]<!-- /shelveslooppriv -->
662                   [% END %]<!-- /showprivateshelves -->
663                   [% ELSE %]<!-- /loggedinusername -->
664                       [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new lists.</div>[% END %]
665                   [% END %]<!-- /loggedinusername -->
666
667                   
668                             </div><!-- /privateshelves -->
669
670                   [% IF ( showpublicshelves ) %]
671                     <div id="publicshelves" class="tab-container" style="display:block;">
672                   [% ELSE %]
673                     <div id="publicshelves" class="tab-container" style="display:none;">
674                   [% END %]
675                   [% IF ( loggedinusername ) %]
676                  <div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a></div>
677                   [% ELSE %]
678                   [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new lists.</div>[% END %]
679                   [% END %]
680                   [% IF ( shelvesloop ) %]
681                       <table>
682                         <tr>
683                           <th>List name</th>
684                           <th>Contents</th>
685                           <th>Type</th><th>&nbsp;</th>
686                         </tr>
687                     [% FOREACH shelvesloo IN shelvesloop %]
688                       [% UNLESS ( loop.odd ) %]
689                         <tr class="highlight">
690                       [% ELSE %]
691                         <tr>
692                       [% END %]
693                           <td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
694                           <td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
695                           <td>
696                             [% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
697                             [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
698                               </td>
699                           <td>
700                                                         [% IF ( shelvesloo.mine ) %]
701                               <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
702                                 <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
703                                 <input type="hidden" name="op" value="modif" />
704                                 <input type="hidden" name="display" value="publicshelves" />
705                                 <input type="submit" class="editshelf" value="Edit" />
706                               </form>
707                               <form action="opac-shelves.pl" method="post">
708                                 <input type="hidden" name="shelves" value="1" />
709                                 <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
710                                 [% IF ( shelvesloo.confirm ) %]
711                                   <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
712                                   <input type="submit" class="confirm" value="Confirm" />
713                                 [% ELSE %]
714                                   <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
715                                 [% END %]
716                               </form>
717                             [% END %]&nbsp;
718                           </td>
719                         </tr>
720                     [% END %]<!-- /shelvesloop -->
721                       </table>
722                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
723                   [% ELSE %]<!-- /shelvesloop -->
724                     [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
725                   [% END %]<!-- /shelvesloop -->
726                   
727                     </div><!-- /publicshelves -->
728                     
729                 [% END %]<!-- /shelves -->
730               [% END %]<!-- /viewshelf -->
731             [% END %]<!-- /edit -->
732
733             [% IF ( shelves ) %]
734               <div id="addshelf">
735                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
736                   <fieldset class="rows">
737                     <legend>Create a new list</legend>
738                     <input type="hidden" name="shelves" value="1" />
739                     <ol>
740                       <li>
741                         <label class="required" for="addshelf">List name:</label>
742                         [% IF ( already ) %]
743                           <input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
744                         [% ELSE %]
745                           <input id="addshelf" type="text" name="addshelf" size="60" />
746                         [% END %]
747                         <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
748                       </li>
749                       <li>
750                         <label for="sortfield" >Sort this list by: </label>
751                         <select name="sortfield" id="sortfield">
752                           <option value="title">Title</option>
753                           <option value="author">Author</option>
754                           <option value="copyrightdate">Year</option>
755                           <option value="itemcallnumber">Call number</option>
756                         </select>
757                       </li>
758                       <li>
759                         <label for="category">Category:</label>
760                         <select name="category" id="category">
761                           <option value="1">Private</option>
762                           [% IF (OpacAllowPublicListCreation) %]
763                           <option value="2">Public</option>
764                           [% END %]
765                         </select>
766                       </li>
767                       [% INCLUDE list_permissions %]
768                     </ol>
769                   </fieldset>
770                   <fieldset class="action">
771                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
772                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
773                   </fieldset>
774                 </form>
775               </div>
776             [% END %]<!-- /shelves -->
777
778             
779             </div>
780           </div>
781         </div>
782       </div>
783       [% IF ( OpacNav||loggedinusername ) %]
784         <div class="yui-b">
785           <div id="leftmenus" class="container">
786             [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
787           </div>
788         </div>
789       [% END %]
790     </div><!-- /bd -->
791
792 <!-- </div> -->
793 <!-- DEBUG -->
794     <div id="debug"></div>
795
796 [% INCLUDE 'opac-bottom.inc' %]