Merge remote-tracking branch 'origin/new/bug_3215'
[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 <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>
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" />[% 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>
213                       <form method="post" action="opac-shelves.pl" class="tag_hides">
214                         <input type="hidden" value="1" name="shelves"/>
215                     [% IF ( showprivateshelves ) %]
216                          <input type="hidden" name="display" value="privateshelves" />
217                     [% END %]
218                          <input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
219                          <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
220                       </form> [% END %]
221
222
223                   </div>
224
225                   <form action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform" class="checkboxed">
226                 [% IF ( manageshelf ) %]
227                     <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
228                     <input type="hidden" name="modifyshelfcontents" value="1" />
229                 [% END %]
230                 <div class="searchresults">
231                 <table id="listcontents">
232                   <tbody>
233                   [% FOREACH itemsloo IN itemsloop %]
234                     [% UNLESS ( loop.odd ) %]
235                       <tr class="highlight">
236                     [% ELSE %]
237                       <tr>
238                     [% END %]
239                         <td><input type="checkbox" name="REM-[% itemsloo.biblionumber %]"
240                                    value="[% itemsloo.biblionumber %]" /></td>
241                     [% UNLESS ( item_level_itypes ) %]
242                         <td>
243                           [% UNLESS ( noItemTypeImages ) %]
244                           <img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
245                           [% END %]
246                           [% itemsloo.description %]
247                         </td>
248                     [% END %]
249                         <td>
250                         [% IF ( itemsloo.XSLTBloc ) %]
251                          [% itemsloo.XSLTBloc %]
252                         [% ELSE %]
253
254                                 [% IF ( itemsloo.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
255                                 [% ELSE %]
256                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
257                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
258                                 [% END %]
259                                 [% END %]
260                 [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield|html %][% END %]</a>
261                                 [% 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>
262                                 [% ELSE %]&nbsp;
263                                 [% END %]
264         <span class="results_summary"><span class="label">Publication:</span>
265                         [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode|html %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %]
266                     [% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %]
267                         [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
268                         [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %]
269                         [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
270                 </span>
271                 <span class="results_summary"><span class="label">Holdings:</span>[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
272           [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
273           [% IF ( ITEM_RESULT.itemcallnumber ) %]
274         ([% ITEM_RESULT.itemcallnumber %])[% IF ( loop.last ) %].[% ELSE %],[% END %]
275           [% END %]
276           [% END %][% ELSE %]This record has no items.[% END %]</span>
277             [% END %]
278         [% IF ( TagsEnabled ) %]
279           [% IF ( TagsShowOnList ) %]
280             [% IF ( itemsloo.TagLoop.size ) %]
281               <div class="results_summary">
282               <span class="label">Tags:</span>
283               <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>
284                   [% END %]
285               </ul>
286               </div>
287             [% END %]
288           [% END %]
289                 [% IF ( TagsInputOnList ) %]
290           [% IF ( loggedinusername ) %]
291                         <label for="newtag[% itemsloo.biblionumber %]">New tag:</label>
292                         <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
293                         <input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
294                     <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
295                         Tag status here.
296                     </span>
297                     [% ELSIF ( loop.first ) %]<span class="tagstatus" id="login4tags">Log in to add tags.</span>
298                   [% END %]
299                 [% ELSE %]
300             [% IF ( loggedinusername ) %]
301               <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus results_summary" style="display:none;">Tag status here.</span>
302             [% END %]
303                 [% END %]
304         [% END %]
305
306 <span class="results_summary actions"><span class="label">Actions:</span>
307       [% IF ( RequestOnOpac ) %]
308           [% UNLESS ( itemsloo.norequests ) %]
309             [% IF ( opacuserlogin ) %]
310               [% IF ( AllowOnShelfHolds ) %]
311                 <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
312               [% ELSE %]
313                 [% IF ( itemsloo.itemsissued ) %]
314                   <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
315                 [% END %]
316               [% END %]
317             [% END %]
318           [% END %]
319         [% END %]
320
321         [% 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>
322           [% END %][% END %][% END %]
323           [% IF ( opacbookbag ) %]
324               [% IF ( itemsloo.incart ) %]
325                   <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>
326               [% ELSE %]
327                   <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>
328               [% END %]
329           [% END %]
330         </span>
331
332                           <!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
333                         </td>
334           <td>
335           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
336                     [% 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 %]
337
338           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
339                 <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" />
340                 [% ELSE %]
341                 <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 %]
342
343                 [% 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 %]
344                 </a>
345                 [% 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 %]
346         </td>
347                       </tr>
348                   [% END %]<!-- /itemsloop -->
349                     </tbody>
350                   </table>
351                   </div>
352                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
353                 [% ELSE %]
354                   <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>
355               [% END %]<!-- /itemsloop -->
356             [% END %]<!-- /viewshelf -->
357
358
359             [% IF ( manageshelf ) %]
360               <!-- Editing shelf -->
361               [% IF ( itemsloop ) %]
362                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
363                 <input type="hidden" name="modifyshelfcontents" value="1" />
364                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove Selected Items" class="icon delete" onclick="return confirmDelete(MSG_REMOVE_FROM_LIST)" />
365               [% ELSE %]
366                 <form method="post" action="opac-shelves.pl">
367                   <input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
368                   <input type="hidden" name="shelves" value="1" />
369                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
370                   <input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
371               [% END %]
372             [% END %]
373                 </form>
374
375             
376             [% IF ( edit ) %]
377                 <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>
378                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
379                   <input type="hidden" name="op" value="modifsave" />
380                    [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
381                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
382                   <fieldset class="rows">
383                     <ol>
384                       <li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
385                       <li>
386                         <label for="sortfield" >Sort this list by: </label>
387                         <select name="sortfield" id="sortfield">
388                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
389                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
390                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
391                         </select>
392                       </li>
393                       <li>
394                         <label for="category">Category:</label>
395                         <select name="category" id="category">
396                           [% IF ( category1 ) %]<option value="1" selected="selected">Private</option>[% ELSE %]<option value="1">Private</option>[% END %]
397                           [% IF ( category2 ) %]<option value="2" selected="selected">Public</option>[% ELSE %]<option value="2">Public</option>[% END %]
398                         </select>
399                       </li>
400                     </ol>
401                   </fieldset>
402                   <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>
403                 </form>
404             [% END %]<!-- /edit -->
405
406
407             [% UNLESS ( edit ) %]
408               [% UNLESS ( viewshelf ) %]
409                 [% UNLESS ( shelves ) %]
410                   <h2>Lists</h2>
411                   <ul class="link-tabs">
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                   [% IF ( showpublicshelves ) %]
418                     <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
419                   [% ELSE %]
420                     <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
421                   [% END %]
422                   </ul>
423                   
424                   [% IF ( showprivateshelves ) %]
425                     <div id="privateshelves" class="tab-container" style="display:block;">
426                   [% ELSE %]
427                     <div id="privateshelves" class="tab-container" style="display:none;">
428                   [% END %]
429         
430                   [% IF ( loggedinusername ) %]
431                     <div id="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
432                   [% IF ( showprivateshelves ) %]
433                     [% IF ( shelveslooppriv ) %]
434                       <table>
435                         <tr>
436                           <th>List Name</th>
437                           <th>Contents</th>
438                           <th>Type</th>
439                           <th>&nbsp;</th>
440                         </tr>
441                         [% FOREACH shelveslooppri IN shelveslooppriv %]
442                           [% UNLESS ( loop.odd ) %]
443                             <tr class="highlight">
444                           [% ELSE %]
445                             <tr>
446                           [% END %]
447                               <td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
448                               <td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
449                               <td>
450                                 [% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
451                                 [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
452                                 [% IF ( shelveslooppri.viewcategory3 ) %]Open[% END %]
453                               </td>
454                               <td>
455                               [% IF ( shelveslooppri.mine ) %]
456                                 <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
457                                   <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
458                                   <input type="hidden" name="display" value="privateshelves" />
459                                   <input type="hidden" name="op" value="modif" />
460                                   <input type="submit" class="editshelf" value="Edit" />
461                                 </form>
462                                 <form action="opac-shelves.pl" method="post">
463                                   <input type="hidden" name="shelves" value="1" />
464                                   <input type="hidden" name="display" value="privateshelves" />
465                                   <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
466                                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
467                               [% IF ( shelveslooppri.confirm ) %]
468                                     <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
469                                     <input type="submit" class="confirm" value="Confirm" />
470                               [% ELSE %]
471                                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
472                               [% END %]
473                                 </form>
474                             [% END %]&nbsp;
475                             </td>
476                           </tr>
477                         [% END %]
478                       </table>
479                       <div class="pages">[% pagination_bar %]</div>
480                     [% ELSE %]
481                          <p>No private lists.</p>
482                     [% END %]<!-- /shelveslooppriv -->
483                   [% END %]<!-- /showprivateshelves -->
484                   [% ELSE %]<!-- /loggedinusername -->
485                       <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
486                   [% END %]<!-- /loggedinusername -->
487
488                   
489                             </div><!-- /privateshelves -->
490
491                   [% IF ( showpublicshelves ) %]
492                     <div id="publicshelves" class="tab-container" style="display:block;">
493                   [% ELSE %]
494                     <div id="publicshelves" class="tab-container" style="display:none;">
495                   [% END %]
496                   [% IF ( loggedinusername ) %]
497                  <div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
498                   [% ELSE %]
499                   <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
500                   [% END %]
501                   [% IF ( shelvesloop ) %]
502                       <table>
503                         <tr>
504                           <th>List Name</th>
505                           <th>Contents</th>
506                           <th>Type</th><th>&nbsp;</th>
507                         </tr>
508                     [% FOREACH shelvesloo IN shelvesloop %]
509                       [% UNLESS ( loop.odd ) %]
510                         <tr class="highlight">
511                       [% ELSE %]
512                         <tr>
513                       [% END %]
514                           <td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
515                           <td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
516                           <td>
517                             [% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
518                             [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
519                             [% IF ( shelvesloo.viewcategory3 ) %]Open[% END %]
520                               </td>
521                           <td>
522                                                         [% IF ( shelvesloo.mine ) %]
523                               <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
524                                 <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
525                                 <input type="hidden" name="op" value="modif" />
526                                 <input type="submit" class="editshelf" value="Edit" />
527                               </form>
528                               <form action="opac-shelves.pl" method="post">
529                                 <input type="hidden" name="shelves" value="1" />
530                                 <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
531                                 [% IF ( shelvesloo.confirm ) %]
532                                   <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
533                                   <input type="submit" class="confirm" value="Confirm" />
534                                 [% ELSE %]
535                                   <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
536                                 [% END %]
537                               </form>
538                             [% END %]&nbsp;
539                           </td>
540                         </tr>
541                     [% END %]<!-- /shelvesloop -->
542                       </table>
543                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
544                   [% ELSE %]<!-- /shelvesloop -->
545                     [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
546                   [% END %]<!-- /shelvesloop -->
547                   
548                     </div><!-- /publicshelves -->
549                     
550                 [% END %]<!-- /shelves -->
551               [% END %]<!-- /viewshelf -->
552             [% END %]<!-- /edit -->
553
554             [% IF ( shelves ) %]
555               <div id="addshelf">
556                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
557                   <fieldset class="rows">
558                     <legend>Create a New List</legend>
559                     <input type="hidden" name="shelves" value="1" />
560                     <ol>
561                       <li>
562                         <label class="required" for="addshelf">List Name:</label>
563                         [% IF ( already ) %]
564                           <input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
565                         [% ELSE %]
566                           <input id="addshelf" type="text" name="addshelf" size="60" />
567                         [% END %]
568                         <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
569                       </li>
570                       <li>
571                         <label for="sortfield" >Sort this list by: </label>
572                         <select name="sortfield" id="sortfield">
573                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
574                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
575                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
576                         </select>
577                       </li>
578                       <li>
579                         <label for="category">Category:</label>
580                         <select name="category" id="category">
581                           <option value="1">Private</option>
582                           <option value="2">Public</option>
583                         </select>
584                       </li>
585                     </ol>
586                   </fieldset>
587                   <fieldset class="action">
588                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
589                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
590                   </fieldset>
591                 </form>
592               </div>
593             [% END %]<!-- /shelves -->
594
595             
596             </div>
597           </div>
598         </div>
599       </div>
600       [% IF ( OpacNav||loggedinusername ) %]
601         <div class="yui-b">
602           <div id="leftmenus" class="container">
603             [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
604           </div>
605         </div>
606       [% END %]
607     </div><!-- /bd -->
608
609 <!-- </div> -->
610 <!-- DEBUG -->
611     <div id="debug"></div>
612
613 [% INCLUDE 'opac-bottom.inc' %]