Merge remote-tracking branch 'origin/new/bug_7368'
[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 %]Your 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 ( loggedinusername ) %]
96             $("#tagsel_tag").click(function(){
97                 tagSelected();
98                 return false;
99             });
100             $("#tagsel_cancel").click(function(){
101                 tagCanceled();
102                 return false;
103             });
104             $("#tagsel_button").click(function(){
105                 tagAdded();
106                 return false;
107             });
108         [% ELSE %]
109             $("#tagsel_tag").click(function(){
110                 window.location = "/cgi-bin/koha/opac-user.pl";
111                 return false;
112             });
113         [% END %]
114         [% END %][% END %][% END %]
115   [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
116 });
117       function Check(f) {
118                 var _alertString="";
119                 var alertString2;
120
121             if(f.addshelf.value.length ==0){
122                         _alertString += _("- You must enter a List Name") + "\n";
123                 }
124
125                 if (_alertString.length==0) {
126                         f.submit();
127                 } else {
128                         alertString2 = _("Form not submitted because of the following problem(s)");
129                         alertString2 += "\n------------------------------------------------------------------------------------\n\n";
130                         alertString2 += _alertString;
131                         alert(alertString2);
132                 }
133         }
134 //]]>
135 </script>
136 </head>
137 [% IF ( loggedinusername ) %]<body id="opac-userlists">[% ELSE %]<body id="opac-lists">[% END %]
138 [% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSIF ( loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
139     <div id="bd">
140       [% INCLUDE 'masthead.inc' %]
141       <div id="yui-main">
142         <div class="yui-b">
143           <div id="usershelves" class="container">
144           
145             [% IF ( paramsloop ) %]
146               [% FOREACH paramsloo IN paramsloop %]
147                 <div class="yui-ge">
148                   <div class="yui-u first">
149                     [% IF ( paramsloo.already ) %]<div class="dialog alert">A List named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
150                     [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
151                     [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %]
152                     [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %]
153                     [% IF ( paramsloo.need_confirm ) %]
154                       <div class="dialog alert">
155                         The list <i>[% paramsloo.need_confirm %]</i> is not empty.
156                         <br />It has <b>[% paramsloo.count %]</b> [% IF ( paramsloo.single ) %]entry[% ELSE %]entries[% END %].
157                         <br />Use the "Confirm" button below to confirm deletion.
158                      </div>
159                     [% END %]
160                     [% IF ( paramsloo.nopermission ) %]
161                       <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div>
162                     [% END %]
163                     [% IF ( paramsloo.failgetitem ) %]
164                       <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
165                     [% END %]
166                     [% IF ( paramsloo.duplicatebiblio ) %]
167                       <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
168                     [% END %]
169                     [% IF ( paramsloo.delete_ok ) %]
170                       <div class="dialog message">List [% paramsloo.delete_ok %] Deleted.</div>
171                     [% END %]
172                     [% IF ( paramsloo.delete_fail ) %]
173                       <div class="dialog message">ERROR: Database error. Delete (list number [% paramsloo.delete_fail %]) failed.</div>
174                     [% END %]
175                     [% IF ( paramsloo.unrecognized ) %]
176                       <div class="dialog message">ERROR: List number [% paramsloo.unrecognized %] unrecognized.</div>
177                     [% END %]
178                   </div>
179                 </div>
180               [% END %]<!-- /paramsloop -->
181             [% END %] <!-- /paramsloop -->
182
183             <div class="yui-g">
184
185             [% IF ( viewshelf ) %]<!--  Viewing a particular shelf -->
186               <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>
187               [% IF ( itemsloop ) %]
188                   <div id="toolbar" class="list-actions"> <span class="checkall"></span>
189                     <span class="clearall"></span>
190
191 [% IF ( RequestOnOpac ) %]
192                       <span id="placehold"></span>[% UNLESS ( TagsEnabled ) %] |[% END %]
193 [% END %]
194 [% IF ( loggedinusername ) %]
195     [% IF ( TagsEnabled ) %]
196                     <span id="addtags"></span>
197                     <span id="tagsel_form" style="display:none">
198                       <label for="tagsel_new" style="display:inline">New&nbsp;Tag:</label>
199                       <input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
200                       <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button"
201                              type="submit" value="Add" style="display:inline" />
202                       <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
203                   </span>
204     [% END %][% END %]
205
206                       <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>
207
208 [% IF ( opacuserlogin ) %]<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>[% END %]
209
210 <a class="print tag_hides" href="opac-shelves.pl" onclick="print(); return false;">Print List</a>
211
212                 [% IF ( manageshelf ) %] | <form method="get" action="opac-shelves.pl" class="tag_hides"><input type="hidden" name="op" value="modif" />
213                 <input type="hidden" name="display" value="viewshelf" />
214                 <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                          <input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
218                          <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
219                       </form> [% END %]
220
221
222                   </div>
223
224                   <form action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform" class="checkboxed">
225                 [% IF ( manageshelf ) %]
226                     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
227                     <input type="hidden" name="modifyshelfcontents" value="1" />
228                 [% END %]
229                 <div class="searchresults">
230                 <table id="listcontents">
231                   <tbody>
232                   [% FOREACH itemsloo IN itemsloop %]
233                     [% UNLESS ( loop.odd ) %]
234                       <tr class="highlight">
235                     [% ELSE %]
236                       <tr>
237                     [% END %]
238                         <td><input type="checkbox" name="REM-[% itemsloo.biblionumber %]"
239                                    value="[% itemsloo.biblionumber %]" /></td>
240                     [% UNLESS ( item_level_itypes ) %]
241                         <td>
242                           [% UNLESS ( noItemTypeImages ) %]
243                           <img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
244                           [% END %]
245                           [% itemsloo.description %]
246                         </td>
247                     [% END %]
248                         <td>
249                         [% IF ( itemsloo.XSLTBloc ) %]
250                          [% itemsloo.XSLTBloc %]
251                         [% ELSE %]
252
253                                 [% IF ( itemsloo.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
254                                 [% ELSE %]
255                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
256                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
257                                 [% END %]
258                                 [% END %]
259                 [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield|html %][% END %]</a>
260                                 [% 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>
261                                 [% ELSE %]&nbsp;
262                                 [% END %]
263         <span class="results_summary"><span class="label">Publication:</span>
264                         [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode|html %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %]
265                     [% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %]
266                         [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
267                         [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %]
268                         [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
269                 </span>
270                 <span class="results_summary"><span class="label">Holdings:</span>[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
271           [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
272           [% IF ( ITEM_RESULT.itemcallnumber ) %]
273         ([% ITEM_RESULT.itemcallnumber %])[% IF ( loop.last ) %].[% ELSE %],[% END %]
274           [% END %]
275           [% END %][% ELSE %]This record has no items.[% END %]</span>
276             [% END %]
277         [% IF ( TagsEnabled ) %]
278           [% IF ( TagsShowOnList ) %]
279             [% IF ( itemsloo.TagLoop.size ) %]
280               <div class="results_summary">
281               <span class="label">Tags:</span>
282               <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>
283                   [% END %]
284               </ul>
285               </div>
286             [% END %]
287           [% END %]
288                 [% IF ( TagsInputOnList ) %]
289           [% IF ( loggedinusername ) %]
290                         <label for="newtag[% itemsloo.biblionumber %]">New tag:</label>
291                         <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
292                         <input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
293                     <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
294                         Tag status here.
295                     </span>
296                     [% ELSIF ( loop.first ) %]<span class="tagstatus" id="login4tags">Log in to add tags.</span>
297                   [% END %]
298                 [% ELSE %]
299             [% IF ( loggedinusername ) %]
300               <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus results_summary" style="display:none;">Tag status here.</span>
301             [% END %]
302                 [% END %]
303         [% END %]
304
305 <span class="results_summary actions"><span class="label">Actions:</span>
306       [% IF ( RequestOnOpac ) %]
307           [% UNLESS ( itemsloo.norequests ) %]
308             [% IF ( opacuserlogin ) %]
309               [% IF ( AllowOnShelfHolds ) %]
310                 <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
311               [% ELSE %]
312                 [% IF ( itemsloo.itemsissued ) %]
313                   <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
314                 [% END %]
315               [% END %]
316             [% END %]
317           [% END %]
318         [% END %]
319
320         [% 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>
321           [% END %][% END %][% END %]
322           [% IF ( opacbookbag ) %]
323               [% IF ( itemsloo.incart ) %]
324                   <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>
325               [% ELSE %]
326                   <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>
327               [% END %]
328           [% END %]
329         </span>
330
331                           <!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
332                         </td>
333           <td>
334           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
335                     [% 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 %]
336
337           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
338                 <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" />
339                 [% ELSE %]
340                 <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 %]
341
342                 [% 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 %]
343                 </a>
344                 [% 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 %]
345         </td>
346                       </tr>
347                   [% END %]<!-- /itemsloop -->
348                     </tbody>
349                   </table>
350                   </div>
351                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
352                 [% ELSE %]
353                   <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>
354               [% END %]<!-- /itemsloop -->
355             [% END %]<!-- /viewshelf -->
356
357
358             [% IF ( manageshelf ) %]
359               <!-- Editing shelf -->
360               [% IF ( itemsloop ) %]
361                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
362                 <input type="hidden" name="modifyshelfcontents" value="1" />
363                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove Selected Items" class="icon delete" onclick="return confirmDelete(MSG_REMOVE_FROM_LIST)" />
364               [% ELSE %]
365                 <form method="post" action="opac-shelves.pl">
366                   <input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
367                   <input type="hidden" name="shelves" value="1" />
368                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
369                   <input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
370               [% END %]
371             [% END %]
372                 </form>
373
374             
375             [% IF ( edit ) %]
376                 <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>
377                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
378                   <input type="hidden" name="op" value="modifsave" />
379                   <input type="hidden" name="display" value="[% display %]" />
380                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
381                   <fieldset class="rows">
382                     <ol>
383                       <li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
384                       <li>
385                         <label for="sortfield" >Sort this list by: </label>
386                         <select name="sortfield" id="sortfield">
387                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
388                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
389                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
390                         </select>
391                       </li>
392                       <li>
393                         <label for="category">Category:</label>
394                         <select name="category" id="category">
395                           [% IF ( category1 ) %]<option value="1" selected="selected">Private</option>[% ELSE %]<option value="1">Private</option>[% END %]
396                           [% IF ( category2 ) %]<option value="2" selected="selected">Public</option>[% ELSE %]<option value="2">Public</option>[% END %]
397                         </select>
398                       </li>
399                     </ol>
400                   </fieldset>
401                   <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>
402                 </form>
403             [% END %]<!-- /edit -->
404
405
406             [% UNLESS ( edit ) %]
407               [% UNLESS ( viewshelf ) %]
408                 [% UNLESS ( shelves ) %]
409                   <h2>Lists</h2>
410                   <ul class="link-tabs">
411                   [% IF ( opacuserlogin ) %]
412                   [% IF ( showprivateshelves ) %]
413                     <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
414                   [% ELSE %]
415                     <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
416                   [% END %]
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                       [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>[% END %]
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                   [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>[% END %]
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="hidden" name="display" value="publicshelves" />
528                                 <input type="submit" class="editshelf" value="Edit" />
529                               </form>
530                               <form action="opac-shelves.pl" method="post">
531                                 <input type="hidden" name="shelves" value="1" />
532                                 <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
533                                 [% IF ( shelvesloo.confirm ) %]
534                                   <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
535                                   <input type="submit" class="confirm" value="Confirm" />
536                                 [% ELSE %]
537                                   <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
538                                 [% END %]
539                               </form>
540                             [% END %]&nbsp;
541                           </td>
542                         </tr>
543                     [% END %]<!-- /shelvesloop -->
544                       </table>
545                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
546                   [% ELSE %]<!-- /shelvesloop -->
547                     [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
548                   [% END %]<!-- /shelvesloop -->
549                   
550                     </div><!-- /publicshelves -->
551                     
552                 [% END %]<!-- /shelves -->
553               [% END %]<!-- /viewshelf -->
554             [% END %]<!-- /edit -->
555
556             [% IF ( shelves ) %]
557               <div id="addshelf">
558                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
559                   <fieldset class="rows">
560                     <legend>Create a New List</legend>
561                     <input type="hidden" name="shelves" value="1" />
562                     <ol>
563                       <li>
564                         <label class="required" for="addshelf">List Name:</label>
565                         [% IF ( already ) %]
566                           <input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
567                         [% ELSE %]
568                           <input id="addshelf" type="text" name="addshelf" size="60" />
569                         [% END %]
570                         <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
571                       </li>
572                       <li>
573                         <label for="sortfield" >Sort this list by: </label>
574                         <select name="sortfield" id="sortfield">
575                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
576                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
577                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
578                         </select>
579                       </li>
580                       <li>
581                         <label for="category">Category:</label>
582                         <select name="category" id="category">
583                           <option value="1">Private</option>
584                           <option value="2">Public</option>
585                         </select>
586                       </li>
587                     </ol>
588                   </fieldset>
589                   <fieldset class="action">
590                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
591                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
592                   </fieldset>
593                 </form>
594               </div>
595             [% END %]<!-- /shelves -->
596
597             
598             </div>
599           </div>
600         </div>
601       </div>
602       [% IF ( OpacNav||loggedinusername ) %]
603         <div class="yui-b">
604           <div id="leftmenus" class="container">
605             [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
606           </div>
607         </div>
608       [% END %]
609     </div><!-- /bd -->
610
611 <!-- </div> -->
612 <!-- DEBUG -->
613     <div id="debug"></div>
614
615 [% INCLUDE 'opac-bottom.inc' %]