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