Merge remote-tracking branch 'origin/new/bug_6291'
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-shelves.tt
1 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog ›   [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]My Lists[% END %][% INCLUDE 'doc-head-close.inc' %]
2 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
3 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
4 <script type="text/javascript">
5 //<![CDATA[
6 var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
7 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
8 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
9
10 [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
11 function holdSelections() {
12     var checkedBoxes = $(":checkbox:checked");
13     if ($(checkedBoxes).size() == 0) {
14         alert(MSG_NO_RECORD_SELECTED);
15     } else {
16         var bibs = "";
17         $(checkedBoxes).each(function(){
18             var name = $(this).attr("name");
19             bib = name.substr(4);
20             bibs += bib + "/";
21         });
22         document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
23     }
24 }
25 [% END %][% END %]
26 [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]function tagSelected() {
27     var checkedBoxes = $("input:checkbox:checked");
28     if ($(checkedBoxes).size()) {
29         $("#tagsel_tag").hide();
30         $(".tag_hides").hide();
31         $("#tagsel_form").show();
32     } else {
33         alert(MSG_NO_RECORD_SELECTED);
34     }
35 }
36
37 function tagCanceled() {
38     $("#tagsel_form").hide();
39     $("#tagsel_tag").show();
40     $(".tag_hides").show();
41 }
42
43 function tagAdded() {
44     var checkedBoxes = $("input:checkbox:checked");
45     if (!$(checkedBoxes).size()) {
46         alert(MSG_NO_RECORD_SELECTED);
47         return false;
48     }
49
50     var tag = $("#tagsel_new").val();
51     if (!tag || (tag == "")) {
52         alert(MSG_NO_TAG_SPECIFIED);
53         return false;
54     }
55
56     var bibs = [];
57     for (var i = 0; i < $(checkedBoxes).size(); i++) {
58         var box = $(checkedBoxes).get(i);
59         bibs[i] = $(box).val();
60     }
61
62     KOHA.Tags.add_multitags_button(bibs, tag);
63     return false;
64 }[% END %][% END %][% END %]
65
66 $(function() {
67     [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
68     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_('Clear All')+"<\/a>|");
69     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_('Select All')+"<\/a>");
70   $("a.print").show();
71
72     [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]$("#placehold").html("<a href=\"#\" class=\"hold tag_hides\">"+_('Place Hold')+"<\/a>");
73       $("#toolbar a.hold").click(function(){
74          holdSelections();
75          return false;
76       });[% END %][% END %]
77
78     $("#CheckAll").click(function(){
79         $(".checkboxed").checkCheckboxes();
80         return false;
81     });
82     $("#CheckNone").click(function(){
83         $(".checkboxed").unCheckCheckboxes();
84         return false;
85     });
86
87     [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
88           $("#addtags").click(function(){
89             tagSelected();
90             return false;
91           });
92           $("#addtags").html("<a id=\"tagsel_tag\" href=\"#\">"+_("Tag")+"<\/a> |");
93
94         $(".tagbutton").click(KOHA.Tags.add_tag_button);
95       [% IF ( TagsInputOnList ) %]
96       [% IF ( loggedinusername ) %]
97             $("#tagsel_tag").click(function(){
98                 tagSelected();
99                 return false;
100             });
101             $("#tagsel_cancel").click(function(){
102                 tagCanceled();
103                 return false;
104             });
105             $("#tagsel_button").click(function(){
106                 tagAdded();
107                 return false;
108             });
109         [% ELSE %]
110             $("#tagsel_tag").click(function(){
111                 window.location = "/cgi-bin/koha/opac-user.pl";
112                 return false;
113             });
114         [% END %]
115         [% END %]
116         [% END %][% END %][% END %]
117   [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
118 });
119       function Check(f) {
120                 var _alertString="";
121                 var alertString2;
122
123             if(f.addshelf.value.length ==0){
124                         _alertString += _("- You must enter a List Name") + "\n";
125                 }
126
127                 if (_alertString.length==0) {
128                         f.submit();
129                 } else {
130                         alertString2 = _("Form not submitted because of the following problem(s)");
131                         alertString2 += "\n------------------------------------------------------------------------------------\n\n";
132                         alertString2 += _alertString;
133                         alert(alertString2);
134                 }
135         }
136 //]]>
137 </script>
138 </head>
139 [% IF ( loggedinusername ) %]<body id="opac-userlists">[% ELSE %]<body id="opac-lists">[% END %]
140 [% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSIF ( loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
141     <div id="bd">
142       [% INCLUDE 'masthead.inc' %]
143       <div id="yui-main">
144         <div class="yui-b">
145           <div id="usershelves" class="container">
146           
147             [% IF ( paramsloop ) %]
148               [% FOREACH paramsloo IN paramsloop %]
149                 <div class="yui-ge">
150                   <div class="yui-u first">
151                     [% IF ( paramsloo.already ) %]<div class="dialog alert">A List named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
152                     [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
153                     [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %]
154                     [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %]
155                     [% IF ( paramsloo.need_confirm ) %]
156                       <div class="dialog alert">
157                         The list <i>[% paramsloo.need_confirm %]</i> is not empty.
158                         <br />It has <b>[% paramsloo.count %]</b> [% IF ( paramsloo.single ) %]entry[% ELSE %]entries[% END %].
159                         <br />Use the "Confirm" button below to confirm deletion.
160                      </div>
161                     [% END %]
162                     [% IF ( paramsloo.nopermission ) %]
163                       <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div>
164                     [% END %]
165                     [% IF ( paramsloo.failgetitem ) %]
166                       <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
167                     [% END %]
168                     [% IF ( paramsloo.duplicatebiblio ) %]
169                       <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
170                     [% END %]
171                     [% IF ( paramsloo.delete_ok ) %]
172                       <div class="dialog message">List [% paramsloo.delete_ok %] Deleted.</div>
173                     [% END %]
174                     [% IF ( paramsloo.delete_fail ) %]
175                       <div class="dialog message">ERROR: Database error. Delete (list number [% paramsloo.delete_fail %]) failed.</div>
176                     [% END %]
177                     [% IF ( paramsloo.unrecognized ) %]
178                       <div class="dialog message">ERROR: List number [% paramsloo.unrecognized %] unrecognized.</div>
179                     [% END %]
180                   </div>
181                 </div>
182               [% END %]<!-- /paramsloop -->
183             [% END %] <!-- /paramsloop -->
184
185             <div class="yui-g">
186
187             [% IF ( viewshelf ) %]<!--  Viewing a particular shelf -->
188               <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <em>[% shelfname |html %]</em></h3>
189               [% IF ( itemsloop ) %]
190                   <div id="toolbar" class="list-actions"> <span class="checkall"></span>
191                     <span class="clearall"></span>
192
193 [% IF ( RequestOnOpac ) %]
194                       <span id="placehold"></span>[% UNLESS ( TagsEnabled ) %] |[% END %]
195 [% END %]
196 [% IF ( loggedinusername ) %]
197     [% IF ( TagsEnabled ) %]
198                     <span id="addtags"></span>
199                     <span id="tagsel_form" style="display:none">
200                       <label for="tagsel_new" style="display:inline">New&nbsp;Tag:</label>
201                       <input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
202                       <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button"
203                              type="submit" value="Add" style="display:inline" />
204                       <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
205                   </span>
206     [% END %][% END %]
207
208                       <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download tag_hides" onclick="open(CGIBIN+'opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download List</a>
209
210 <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send tag_hides" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send List</a></span>
211
212 <a class="print tag_hides" href="opac-shelves.pl" onclick="print(); return false;">Print List</a>
213
214                 [% IF ( manageshelf ) %] | <form method="get" action="opac-shelves.pl" class="tag_hides"><input type="hidden" name="op" value="modif" />[% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %] <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf tag_hides" value="Edit List" /></form>
215                       <form method="post" action="opac-shelves.pl" class="tag_hides">
216                         <input type="hidden" value="1" name="shelves"/>
217                     [% IF ( showprivateshelves ) %]
218                          <input type="hidden" name="display" value="privateshelves" />
219                     [% END %]
220                          <input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
221                          <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
222                       </form> [% END %]
223
224
225                   </div>
226
227                   <form action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform" class="checkboxed">
228                 [% IF ( manageshelf ) %]
229                     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
230                     <input type="hidden" name="modifyshelfcontents" value="1" />
231                 [% END %]
232                 <div class="searchresults">
233                 <table id="listcontents">
234                   <tbody>
235                   [% FOREACH itemsloo IN itemsloop %]
236                     [% UNLESS ( loop.odd ) %]
237                       <tr class="highlight">
238                     [% ELSE %]
239                       <tr>
240                     [% END %]
241                         <td><input type="checkbox" name="REM-[% itemsloo.biblionumber %]"
242                                    value="[% itemsloo.biblionumber %]" /></td>
243                     [% UNLESS ( item_level_itypes ) %]
244                         <td>
245                           [% UNLESS ( noItemTypeImages ) %]
246                           <img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
247                           [% END %]
248                           [% itemsloo.description %]
249                         </td>
250                     [% END %]
251                         <td>
252                         [% IF ( itemsloo.XSLTBloc ) %]
253                          [% itemsloo.XSLTBloc %]
254                         [% ELSE %]
255
256                                 [% IF ( itemsloo.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
257                                 [% ELSE %]
258                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
259                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
260                                 [% END %]
261                                 [% END %]
262                 [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield %][% END %]</a>
263                                 [% 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>
264                                 [% ELSE %]&nbsp;
265                                 [% END %]
266         <span class="results_summary"><span class="label">Publication:</span>
267                         [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %]
268                     [% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %]
269                         [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
270                         [% IF ( itemsloo.notes ) %], [% itemsloo.notes %][% END %]
271                         [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
272                 </span>
273                 <span class="results_summary"><span class="label">Holdings:</span>[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
274           [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
275           [% IF ( ITEM_RESULT.itemcallnumber ) %]
276         ([% ITEM_RESULT.itemcallnumber %])[% IF ( loop.last ) %].[% ELSE %],[% END %]
277           [% END %]
278           [% END %][% ELSE %]This record has no items.[% END %]</span>
279             [% END %]
280         [% IF ( TagsEnabled ) %]
281                 [% IF ( TagsShowOnList ) %]
282                 [% IF ( itemsloo.TagLoop ) %]
283           <div class="results_summary">
284                         <span class="label">Tags:</span>
285                         <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>
286                             [% END %]
287                         </ul>
288                 [% END %]
289                 [% IF ( TagsInputOnList ) %]
290           [% IF ( loggedinusername ) %]
291                     <form name="tagform[% itemsloo.biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl">
292                         <label for="newtag[% itemsloo.biblionumber %]">New tag:</label>
293                         <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
294                         <input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
295                     </form>
296                     <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
297                         Tag status here.
298                     </span>
299                     [% ELSIF ( loop.first ) %]<span class="tagstatus" id="login4tags">Log in to add tags.</span>
300                   [% END %]
301                 [% END %]
302                   [% IF ( itemsloo.TagLoop ) %]
303           </div>[% END %]
304         [% END %]
305                 [% END %]
306
307 <span class="results_summary actions"><span class="label">Actions:</span>
308       [% IF ( RequestOnOpac ) %]
309           [% UNLESS ( itemsloo.norequests ) %]
310             [% IF ( opacuserlogin ) %]
311               [% IF ( AllowOnShelfHolds ) %]
312                 <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
313               [% ELSE %]
314                 [% IF ( itemsloo.itemsissued ) %]
315                   <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
316                 [% END %]
317               [% END %]
318             [% END %]
319           [% END %]
320         [% END %]
321
322         [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtolist" 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>
323           [% END %][% END %][% END %]
324
325             [% IF ( opacbookbag ) %]<a class="addtocart" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">Add to Cart</a>[% ELSE %]nocart[% END %]
326         </span>
327
328
329
330                     <!-- COinS / Openurl -->
331                           <!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
332                           [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<br/>
333                           <div id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>[% END %][% END %][% END %]
334                         </td>
335           <td>
336           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
337                     [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
338
339           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
340                 <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" />
341                 [% ELSE %]
342                 <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" />[% END %][% END %][% END %]
343
344                 [% 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 %]
345                 </a>
346                 [% 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 %]
347         </td>
348                       </tr>
349                   [% END %]<!-- /itemsloop -->
350                     </tbody>
351                   </table>
352                   </div>
353                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
354                 [% ELSE %]
355                   <div class="dialog message">This List is empty.  You can add to your lists from the results of any <a href="opac-main.pl">search</a>!</div>
356               [% END %]<!-- /itemsloop -->
357             [% END %]<!-- /viewshelf -->
358
359
360             [% IF ( manageshelf ) %]
361               <!-- Editing shelf -->
362               [% IF ( itemsloop ) %]
363                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
364                 <input type="hidden" name="modifyshelfcontents" value="1" />
365                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove Selected Items" class="icon delete" onclick="return confirmDelete(MSG_REMOVE_FROM_LIST)" />
366               [% ELSE %]
367                 <form method="post" action="opac-shelves.pl">
368                   <input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
369                   <input type="hidden" name="shelves" value="1" />
370                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
371                   <input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
372               [% END %]
373             [% END %]
374                 </form>
375
376             
377             [% IF ( edit ) %]
378                 <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]"><em>[% shelfname |html %]</em></a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Editing</h3>
379                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
380                   <input type="hidden" name="op" value="modifsave" />
381                    [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
382                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
383                   <fieldset class="rows">
384                     <ol>
385                       <li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
386                       <li>
387                         <label for="sortfield" >Sort this list by: </label>
388                         <select name="sortfield" id="sortfield">
389                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
390                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
391                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
392                         </select>
393                       </li>
394                       <li>
395                         <label for="category">Category:</label>
396                         <select name="category" id="category">
397                           [% IF ( category1 ) %]<option value="1" selected="selected">Private</option>[% ELSE %]<option value="1">Private</option>[% END %]
398                           [% IF ( category2 ) %]<option value="2" selected="selected">Public</option>[% ELSE %]<option value="2">Public</option>[% END %]
399                         </select>
400                       </li>
401                     </ol>
402                   </fieldset>
403                   <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>
404                 </form>
405             [% END %]<!-- /edit -->
406
407
408             [% UNLESS ( edit ) %]
409               [% UNLESS ( viewshelf ) %]
410                 [% UNLESS ( shelves ) %]
411                   <h2>Lists</h2>
412                   <ul class="link-tabs">
413                   [% IF ( showprivateshelves ) %]
414                     <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
415                   [% ELSE %]
416                     <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
417                   [% END %]
418                   [% IF ( showpublicshelves ) %]
419                     <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
420                   [% ELSE %]
421                     <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
422                   [% END %]
423                   </ul>
424                   
425                   [% IF ( showprivateshelves ) %]
426                     <div id="privateshelves" class="tab-container" style="display:block;">
427                   [% ELSE %]
428                     <div id="privateshelves" class="tab-container" style="display:none;">
429                   [% END %]
430         
431                   [% IF ( loggedinusername ) %]
432                     <div id="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
433                   [% IF ( showprivateshelves ) %]
434                     [% IF ( shelveslooppriv ) %]
435                       <table>
436                         <tr>
437                           <th>List Name</th>
438                           <th>Contents</th>
439                           <th>Type</th>
440                           <th>&nbsp;</th>
441                         </tr>
442                         [% FOREACH shelveslooppri IN shelveslooppriv %]
443                           [% UNLESS ( loop.odd ) %]
444                             <tr class="highlight">
445                           [% ELSE %]
446                             <tr>
447                           [% END %]
448                               <td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
449                               <td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
450                               <td>
451                                 [% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
452                                 [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
453                                 [% IF ( shelveslooppri.viewcategory3 ) %]Open[% END %]
454                               </td>
455                               <td>
456                               [% IF ( shelveslooppri.mine ) %]
457                                 <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
458                                   <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
459                                   <input type="hidden" name="display" value="privateshelves" />
460                                   <input type="hidden" name="op" value="modif" />
461                                   <input type="submit" class="editshelf" value="Edit" />
462                                 </form>
463                                 <form action="opac-shelves.pl" method="post">
464                                   <input type="hidden" name="shelves" value="1" />
465                                   <input type="hidden" name="display" value="privateshelves" />
466                                   <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
467                                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
468                               [% IF ( shelveslooppri.confirm ) %]
469                                     <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
470                                     <input type="submit" class="confirm" value="Confirm" />
471                               [% ELSE %]
472                                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
473                               [% END %]
474                                 </form>
475                             [% END %]&nbsp;
476                             </td>
477                           </tr>
478                         [% END %]
479                       </table>
480                       <div class="pages">[% pagination_bar %]</div>
481                     [% ELSE %]
482                          <p>No private lists.</p>
483                     [% END %]<!-- /shelveslooppriv -->
484                   [% END %]<!-- /showprivateshelves -->
485                   [% ELSE %]<!-- /loggedinusername -->
486                       <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
487                   [% END %]<!-- /loggedinusername -->
488
489                   
490                             </div><!-- /privateshelves -->
491
492                   [% IF ( showpublicshelves ) %]
493                     <div id="publicshelves" class="tab-container" style="display:block;">
494                   [% ELSE %]
495                     <div id="publicshelves" class="tab-container" style="display:none;">
496                   [% END %]
497                   [% IF ( loggedinusername ) %]
498                  <div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
499                   [% ELSE %]
500                   <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
501                   [% END %]
502                   [% IF ( shelvesloop ) %]
503                       <table>
504                         <tr>
505                           <th>List Name</th>
506                           <th>Contents</th>
507                           <th>Type</th><th>&nbsp;</th>
508                         </tr>
509                     [% FOREACH shelvesloo IN shelvesloop %]
510                       [% UNLESS ( loop.odd ) %]
511                         <tr class="highlight">
512                       [% ELSE %]
513                         <tr>
514                       [% END %]
515                           <td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
516                           <td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
517                           <td>
518                             [% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
519                             [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
520                             [% IF ( shelvesloo.viewcategory3 ) %]Open[% END %]
521                               </td>
522                           <td>
523                                                         [% IF ( shelvesloo.mine ) %]
524                               <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
525                                 <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
526                                 <input type="hidden" name="op" value="modif" />
527                                 <input type="submit" class="editshelf" value="Edit" />
528                               </form>
529                               <form action="opac-shelves.pl" method="post">
530                                 <input type="hidden" name="shelves" value="1" />
531                                 <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
532                                 [% IF ( shelvesloo.confirm ) %]
533                                   <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
534                                   <input type="submit" class="confirm" value="Confirm" />
535                                 [% ELSE %]
536                                   <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
537                                 [% END %]
538                               </form>
539                             [% END %]&nbsp;
540                           </td>
541                         </tr>
542                     [% END %]<!-- /shelvesloop -->
543                       </table>
544                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
545                   [% ELSE %]<!-- /shelvesloop -->
546                     [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
547                   [% END %]<!-- /shelvesloop -->
548                   
549                     </div><!-- /publicshelves -->
550                     
551                 [% END %]<!-- /shelves -->
552               [% END %]<!-- /viewshelf -->
553             [% END %]<!-- /edit -->
554
555             [% IF ( shelves ) %]
556               <div id="addshelf">
557                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
558                   <fieldset class="rows">
559                     <legend>Create a New List</legend>
560                     <input type="hidden" name="shelves" value="1" />
561                     <ol>
562                       <li>
563                         <label class="required" for="addshelf">List Name:</label>
564                         [% IF ( already ) %]
565                           <input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
566                         [% ELSE %]
567                           <input id="addshelf" type="text" name="addshelf" size="60" />
568                         [% END %]
569                         <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
570                       </li>
571                       <li>
572                         <label for="sortfield" >Sort this list by: </label>
573                         <select name="sortfield" id="sortfield">
574                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
575                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
576                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
577                         </select>
578                       </li>
579                       <li>
580                         <label for="category">Category:</label>
581                         <select name="category" id="category">
582                           <option value="1">Private</option>
583                           <option value="2">Public</option>
584                         </select>
585                       </li>
586                     </ol>
587                   </fieldset>
588                   <fieldset class="action">
589                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
590                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
591                   </fieldset>
592                 </form>
593               </div>
594             [% END %]<!-- /shelves -->
595
596             
597             </div>
598           </div>
599         </div>
600       </div>
601       [% IF ( OpacNav||loggedinusername ) %]
602         <div class="yui-b">
603           <div id="leftmenus" class="container">
604             [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
605           </div>
606         </div>
607       [% END %]
608     </div><!-- /bd -->
609
610 <!-- </div> -->
611 <!-- DEBUG -->
612     <div id="debug"></div>
613
614 [% INCLUDE 'opac-bottom.inc' %]