Merge remote-tracking branch 'origin/new/bug_7453'
[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
324             [% IF ( opacbookbag ) %]<a class="addtocart" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">Add to Cart</a>[% ELSE %]nocart[% END %]
325         </span>
326
327                           <!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
328                         </td>
329           <td>
330           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
331                     [% 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 %]
332
333           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
334                 <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" />
335                 [% ELSE %]
336                 <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 %]
337
338                 [% 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 %]
339                 </a>
340                 [% 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 %]
341         </td>
342                       </tr>
343                   [% END %]<!-- /itemsloop -->
344                     </tbody>
345                   </table>
346                   </div>
347                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
348                 [% ELSE %]
349                   <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>
350               [% END %]<!-- /itemsloop -->
351             [% END %]<!-- /viewshelf -->
352
353
354             [% IF ( manageshelf ) %]
355               <!-- Editing shelf -->
356               [% IF ( itemsloop ) %]
357                 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
358                 <input type="hidden" name="modifyshelfcontents" value="1" />
359                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove Selected Items" class="icon delete" onclick="return confirmDelete(MSG_REMOVE_FROM_LIST)" />
360               [% ELSE %]
361                 <form method="post" action="opac-shelves.pl">
362                   <input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
363                   <input type="hidden" name="shelves" value="1" />
364                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
365                   <input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
366               [% END %]
367             [% END %]
368                 </form>
369
370             
371             [% IF ( edit ) %]
372                 <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>
373                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
374                   <input type="hidden" name="op" value="modifsave" />
375                    [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
376                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
377                   <fieldset class="rows">
378                     <ol>
379                       <li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
380                       <li>
381                         <label for="sortfield" >Sort this list by: </label>
382                         <select name="sortfield" id="sortfield">
383                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
384                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
385                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
386                         </select>
387                       </li>
388                       <li>
389                         <label for="category">Category:</label>
390                         <select name="category" id="category">
391                           [% IF ( category1 ) %]<option value="1" selected="selected">Private</option>[% ELSE %]<option value="1">Private</option>[% END %]
392                           [% IF ( category2 ) %]<option value="2" selected="selected">Public</option>[% ELSE %]<option value="2">Public</option>[% END %]
393                         </select>
394                       </li>
395                     </ol>
396                   </fieldset>
397                   <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>
398                 </form>
399             [% END %]<!-- /edit -->
400
401
402             [% UNLESS ( edit ) %]
403               [% UNLESS ( viewshelf ) %]
404                 [% UNLESS ( shelves ) %]
405                   <h2>Lists</h2>
406                   <ul class="link-tabs">
407                   [% IF ( showprivateshelves ) %]
408                     <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
409                   [% ELSE %]
410                     <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
411                   [% END %]
412                   [% IF ( showpublicshelves ) %]
413                     <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
414                   [% ELSE %]
415                     <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
416                   [% END %]
417                   </ul>
418                   
419                   [% IF ( showprivateshelves ) %]
420                     <div id="privateshelves" class="tab-container" style="display:block;">
421                   [% ELSE %]
422                     <div id="privateshelves" class="tab-container" style="display:none;">
423                   [% END %]
424         
425                   [% IF ( loggedinusername ) %]
426                     <div id="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
427                   [% IF ( showprivateshelves ) %]
428                     [% IF ( shelveslooppriv ) %]
429                       <table>
430                         <tr>
431                           <th>List Name</th>
432                           <th>Contents</th>
433                           <th>Type</th>
434                           <th>&nbsp;</th>
435                         </tr>
436                         [% FOREACH shelveslooppri IN shelveslooppriv %]
437                           [% UNLESS ( loop.odd ) %]
438                             <tr class="highlight">
439                           [% ELSE %]
440                             <tr>
441                           [% END %]
442                               <td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
443                               <td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
444                               <td>
445                                 [% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
446                                 [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
447                                 [% IF ( shelveslooppri.viewcategory3 ) %]Open[% END %]
448                               </td>
449                               <td>
450                               [% IF ( shelveslooppri.mine ) %]
451                                 <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
452                                   <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
453                                   <input type="hidden" name="display" value="privateshelves" />
454                                   <input type="hidden" name="op" value="modif" />
455                                   <input type="submit" class="editshelf" value="Edit" />
456                                 </form>
457                                 <form action="opac-shelves.pl" method="post">
458                                   <input type="hidden" name="shelves" value="1" />
459                                   <input type="hidden" name="display" value="privateshelves" />
460                                   <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
461                                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
462                               [% IF ( shelveslooppri.confirm ) %]
463                                     <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
464                                     <input type="submit" class="confirm" value="Confirm" />
465                               [% ELSE %]
466                                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
467                               [% END %]
468                                 </form>
469                             [% END %]&nbsp;
470                             </td>
471                           </tr>
472                         [% END %]
473                       </table>
474                       <div class="pages">[% pagination_bar %]</div>
475                     [% ELSE %]
476                          <p>No private lists.</p>
477                     [% END %]<!-- /shelveslooppriv -->
478                   [% END %]<!-- /showprivateshelves -->
479                   [% ELSE %]<!-- /loggedinusername -->
480                       <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
481                   [% END %]<!-- /loggedinusername -->
482
483                   
484                             </div><!-- /privateshelves -->
485
486                   [% IF ( showpublicshelves ) %]
487                     <div id="publicshelves" class="tab-container" style="display:block;">
488                   [% ELSE %]
489                     <div id="publicshelves" class="tab-container" style="display:none;">
490                   [% END %]
491                   [% IF ( loggedinusername ) %]
492                  <div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
493                   [% ELSE %]
494                   <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
495                   [% END %]
496                   [% IF ( shelvesloop ) %]
497                       <table>
498                         <tr>
499                           <th>List Name</th>
500                           <th>Contents</th>
501                           <th>Type</th><th>&nbsp;</th>
502                         </tr>
503                     [% FOREACH shelvesloo IN shelvesloop %]
504                       [% UNLESS ( loop.odd ) %]
505                         <tr class="highlight">
506                       [% ELSE %]
507                         <tr>
508                       [% END %]
509                           <td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
510                           <td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
511                           <td>
512                             [% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
513                             [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
514                             [% IF ( shelvesloo.viewcategory3 ) %]Open[% END %]
515                               </td>
516                           <td>
517                                                         [% IF ( shelvesloo.mine ) %]
518                               <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
519                                 <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
520                                 <input type="hidden" name="op" value="modif" />
521                                 <input type="submit" class="editshelf" value="Edit" />
522                               </form>
523                               <form action="opac-shelves.pl" method="post">
524                                 <input type="hidden" name="shelves" value="1" />
525                                 <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
526                                 [% IF ( shelvesloo.confirm ) %]
527                                   <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
528                                   <input type="submit" class="confirm" value="Confirm" />
529                                 [% ELSE %]
530                                   <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
531                                 [% END %]
532                               </form>
533                             [% END %]&nbsp;
534                           </td>
535                         </tr>
536                     [% END %]<!-- /shelvesloop -->
537                       </table>
538                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
539                   [% ELSE %]<!-- /shelvesloop -->
540                     [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
541                   [% END %]<!-- /shelvesloop -->
542                   
543                     </div><!-- /publicshelves -->
544                     
545                 [% END %]<!-- /shelves -->
546               [% END %]<!-- /viewshelf -->
547             [% END %]<!-- /edit -->
548
549             [% IF ( shelves ) %]
550               <div id="addshelf">
551                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
552                   <fieldset class="rows">
553                     <legend>Create a New List</legend>
554                     <input type="hidden" name="shelves" value="1" />
555                     <ol>
556                       <li>
557                         <label class="required" for="addshelf">List Name:</label>
558                         [% IF ( already ) %]
559                           <input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
560                         [% ELSE %]
561                           <input id="addshelf" type="text" name="addshelf" size="60" />
562                         [% END %]
563                         <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
564                       </li>
565                       <li>
566                         <label for="sortfield" >Sort this list by: </label>
567                         <select name="sortfield" id="sortfield">
568                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
569                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
570                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
571                         </select>
572                       </li>
573                       <li>
574                         <label for="category">Category:</label>
575                         <select name="category" id="category">
576                           <option value="1">Private</option>
577                           <option value="2">Public</option>
578                         </select>
579                       </li>
580                     </ol>
581                   </fieldset>
582                   <fieldset class="action">
583                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
584                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
585                   </fieldset>
586                 </form>
587               </div>
588             [% END %]<!-- /shelves -->
589
590             
591             </div>
592           </div>
593         </div>
594       </div>
595       [% IF ( OpacNav||loggedinusername ) %]
596         <div class="yui-b">
597           <div id="leftmenus" class="container">
598             [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
599           </div>
600         </div>
601       [% END %]
602     </div><!-- /bd -->
603
604 <!-- </div> -->
605 <!-- DEBUG -->
606     <div id="debug"></div>
607
608 [% INCLUDE 'opac-bottom.inc' %]