Bug 12405 - Search links on callnumber fails on intranet results page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / virtualshelves / shelves.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; [% IF ( viewshelf ) %]Lists &rsaquo; Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] &rsaquo; Create new list[% END %][% IF ( edit ) %] &rsaquo; Edit list [% shelfname | html %][% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% IF ( viewshelf ) %]
5     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
7 [% END %]
8 <script type="text/javascript">
9 //<![CDATA[ 
10
11 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
12 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
13 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
14 [% IF ( viewshelf ) %]
15 $(document).ready(function(){
16     [% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %]
17     $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\">"+_("Clear all")+"<\/a>");
18     $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\">"+_("Select all")+"<\/a>");
19     $("#CheckAll").click(function(){
20         $(".checkboxed").checkCheckboxes();
21         return false;
22     });
23     $("#CheckNone").click(function(){
24         $(".checkboxed").unCheckCheckboxes();
25         return false;
26     });
27     $(".placehold").on("click",function(e){
28         placeHold();
29         e.preventDefault();
30     });
31     $(".addtocart").show();
32     var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
33     [% IF ( intranetbookbag ) %]
34          param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
35     [% END %]
36     [% IF ( virtualshelves ) %]
37         [% IF ( addbarshelves ) %]
38             param1 += "<optgroup label=\""+_("Your lists:")+"\">";
39             [% FOREACH addbarshelvesloo IN addbarshelvesloop %]
40                 [% IF ( shelfnumber != addbarshelvesloo.shelfnumber ) %]
41                     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";
42                 [% END %]
43             [% END %]
44             param1 += "<\/optgroup>";
45         [% END %]
46         [% IF ( addpubshelves ) %]
47             param1 += "<optgroup label=\""+_("Public lists:")+"\">";
48             [% FOREACH addpubshelvesloo IN addpubshelvesloop %]
49                 [% IF ( shelfnumber != addpubshelvesloo.shelfnumber ) %]
50                     param1 += "<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>";
51                 [% END %]
52             [% END %]
53             param1 += "<\/optgroup>";
54         [% END %]
55         [% IF ( ( addbarshelvesloop && addbarshelvesloop.size > 9 ) || (addpubshelvesloop && addpubshelvesloop.size > 9 )) %]
56             param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
57         [% END %]
58         param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
59     [% END %]
60     param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-mini\">"+_("Save")+"</button>";
61     $("span.addto").html(param1);
62     $("#cartsubmit").on("click",function(e){
63         cartList();
64         e.preventDefault();
65     });
66     $("#addto").change(function(){
67         cartList();
68     });
69     $(".addto").find("input:submit").click(function(e){
70         e.preventDefault();
71         cartList();
72     });
73     $("#selection_ops").show();
74     $(".merge-items").on("click",function(e){
75         e.preventDefault();
76         MergeItems();
77     });
78     $("#listform").on("submit",function(e){
79
80     });
81     $(".list-remove").on("click",function(e){
82         if($(".selection").filter(":checked").length > 0){
83             return confirm(MSG_REMOVE_FROM_LIST);
84         } else {
85             alert(MSG_NO_ITEM_SELECTED);
86             e.preventDefault();
87         }
88     });
89 });
90 [% END %]
91
92         function confirmDelete(message){
93                 if (window.confirm(message)) {
94                     location.href="/cgi-bin/koha/virtualshelves/shelves.pl?[% IF ( showprivateshelves ) %]display=privateshelves&[% END %]shelves=1&DEL-[% shelfnumber %]=1&shelfoff=[% shelfoff %]";
95                 } else { 
96                         return false;
97                 }
98         }
99
100     /**
101      * This function checks if the adequate number of records are checked for merging
102      */
103     function MergeItems() {
104         var checkboxes = $("input:checkbox:checked");
105         var nbCheckbox = checkboxes.length;
106         if (nbCheckbox != 2) {
107             alert(_("Two records must be selected for merging."));
108         } else {
109             location.href='/cgi-bin/koha/cataloguing/merge.pl?biblionumber=' + checkboxes[0].value + '&amp;biblionumber=' + checkboxes[1].value;
110         }
111         return false;
112     }
113
114     /**
115      * This function checks all checkboxes if all are empty,
116      * or unchecks all if any already checked.
117      */
118     function CheckAll(){
119         var checkboxes = document.getElementsByTagName('input');
120         var nbCheckbox = checkboxes.length;
121         var check = areAllChecked();
122         for(var i=0;i<nbCheckbox;i++){
123             if(checkboxes[i].getAttribute('type') == "checkbox" ){
124                 checkboxes[i].checked = (check) ? 0 : 1;
125             }
126         }
127     }
128     /**
129      * This function returns true if ALL checkboxes are checked
130      */
131     function areAllChecked(){
132         var checkboxes = document.getElementsByTagName('input');
133         var nbCheckbox = checkboxes.length;
134         for(var i=0;i<nbCheckbox;i++){
135             if(checkboxes[i].getAttribute('type') == "checkbox" ){
136                 if(checkboxes[i].checked == 0){
137                     return false;
138                 }
139             }
140         }
141         return true;
142     }
143
144 function placeHold () {
145     var checkedItems = $(".selection:checked");
146     if ($(checkedItems).size() == 0) {
147         alert(MSG_NO_ITEM_SELECTED);
148         return false;
149     }
150     var bibs = "";
151     $(checkedItems).each(function() {
152         bibs += $(this).val() + "/";
153     });
154     $("#hold_form_biblios").val(bibs);
155     $("#hold_form").submit();
156     return false;
157 }
158
159     function cartList(){
160         var checkboxes = $("#searchresults").find(":checkbox");
161         var vshelf = vShelfAdd(checkboxes);
162         if($("#addto").find("option:selected").attr("value") == "addtolist"){
163             var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
164             if (vshelf) {
165                  openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf,'popup',500,500);
166             }
167             return false;
168         } else if($("#addto").find("option:selected").attr("value") == "newlist"){
169             if (vshelf) {
170                 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf,'popup',500,500);
171             }
172             return false;
173         } else if($("#addto").find("option:selected").attr("value") == "morelists"){
174             if (vshelf) {
175                 openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf,'popup',500,500);
176             }
177             return false;
178         }
179         if($("#addto").find("option:selected").attr("value") == "addtocart"){
180             addMultiple(checkboxes);
181             return false;
182         }
183     }
184 //]]>
185 </script>
186 </head>
187 <body id="lists_shelves" class="lists">
188 [% INCLUDE 'header.inc' %]
189 [% INCLUDE 'cat-search.inc' %]
190
191 [% BLOCK list_permissions %]
192     <li>
193         <label for="permissions">Permissions: </label>
194         <select name="allow_add" id="allow_add">
195             [% IF allow_add %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
196             [% IF allow_add %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
197         </select>
198         &nbsp;<span>anyone else to add entries.</span>
199     </li>
200     <li>
201         <label>&nbsp;</label>
202         <select name="allow_delete_own" id="allow_delete_own">
203             [% IF allow_delete_own %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
204             [% IF allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
205         </select>
206         &nbsp;<span>anyone to remove his own contributed entries.</span>
207     </li>
208     <li>
209         <label>&nbsp;</label>
210         <select name="allow_delete_other" id="allow_delete_other">
211             [% IF allow_delete_other %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
212             [% IF allow_delete_other %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
213         </select>
214         &nbsp;<span>anyone to remove other contributed entries.</span>
215     </li>
216 [% END %]
217 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a> [% IF ( category1 ) %] &rsaquo; [% IF ( viewshelf || edit ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a> [% ELSE %] Your lists [% END %] [% ELSIF ( category2 ) %] &rsaquo; [% IF ( viewshelf ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a> [% ELSE %] Public lists [% END %] [% ELSIF ( showprivateshelves ) %] &rsaquo; [% IF ( viewshelf || edit ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a> [% ELSE %] Your lists [% END %] [% ELSIF ( showpublicshelves ) %] &rsaquo; [% IF ( viewshelf || edit ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a> [% ELSE %] Public lists [% END %] [% END %]
218
219 [% IF ( viewshelf ) %]&rsaquo; Contents of <i>[% shelfname | html %]</i>[% END %][% IF ( shelves ) %] &rsaquo; Create new list[% END %][% IF ( edit ) %] &rsaquo; Edit list <i>[% shelfname | html %]</i>[% END %]</div>
220
221 <div id="doc2" class="yui-t7">
222  <div id="bd">
223   <div id="yui-main">
224    <div class="yui-g">[% INCLUDE 'virtualshelves-toolbar.inc' %]
225    </div>
226 [% IF ( paramsloop ) %]
227 [% FOREACH paramsloo IN paramsloop %]
228 <div class="yui-ge">
229     <div class="yui-u first">
230         [% IF ( paramsloo.already ) %]<div class="dialog alert">A List named [% paramsloo.already %] already exists!</div>[% END %]
231         [% IF ( paramsloo.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</div>[% END %]
232                 [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
233                 [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] 
234         [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No list number given.</div>[% END %]
235                 [% IF ( paramsloo.need_confirm ) %]
236                 <div class="dialog alert">The list <i>[% paramsloo.need_confirm %]</i> is not empty.
237             [% IF ( paramsloo.single ) %]
238                 <br />It has <b>[% paramsloo.count %]</b> entry.
239             [% ELSE %]
240                 <br />It has <b>[% paramsloo.count %]</b> entries.
241             [% END %]
242                         <br />Use the "Confirm" button below to confirm deletion.
243                 </div>
244                 [% END %]
245                 [% IF ( paramsloo.nopermission ) %]
246                 <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div>
247                 [% END %]
248                 [% IF ( paramsloo.failgetitem ) %]
249                 <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
250                 [% END %] 
251                 [% IF ( paramsloo.duplicatebiblio ) %]
252                 <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
253                 [% END %]
254                 [% IF ( paramsloo.nothingdeleted) %]
255                       <div class="dialog message">Warning: You could not delete any of the selected items from this list.</div>
256                 [% END %]
257                 [% IF ( paramsloo.somedeleted) %]
258                       <div class="dialog message">Warning: You could not delete all selected items from this list.</div>
259                 [% END %]
260                 [% IF ( paramsloo.modifyfailure) %]
261                       <div class="dialog message">ERROR: List could not be modified.</div>
262                 [% END %]
263         </div>
264 </div>
265 [% END %]
266 [% END %] 
267
268 [% IF ( viewshelf ) %]
269    <div class="yui-g">
270     [% IF ( itemsloop ) %]
271
272     <h3>Contents of <i>[% shelfname | html %]</i></h3>
273     <div class="pages">[% pagination_bar %]</div>
274     <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
275         <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
276         <input type="hidden" name="modifyshelfcontents" value="1" />
277
278 [% IF direction == 'asc' %]
279     [% SET new_direction = 'desc' %]
280 [% ELSE %]
281     [% SET direction = 'desc' %]
282     [% SET new_direction = 'asc' %]
283 [% END %]
284
285 <div id="searchheader">
286     [% IF ( itemsloop ) %]
287         <div id="selection_ops"><span class="checkall"></span> |
288         <span class="clearall"></span>
289
290         <span class="addto">| </span>
291         &nbsp;
292         [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %]
293             <div class="btn-group"><button class="btn btn-mini placehold"><i class="icon-hold"></i> Place hold</button></div>
294         [% END %]
295         [% IF ( allowremovingitems ) %]
296             <div class="btn-group"><button type="submit" class="btn btn-mini list-remove"><i class="icon-remove-sign"></i> Remove selected</button></div>
297         [% END %]
298         [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<div class="btn-group"><button type="submit" class="btn btn-mini merge-items"><i class="icon-merge"></i> Merge selected</button></div>[% END %]
299         </div>
300     [% END %]
301 </div>
302
303     <table id="searchresults">
304             <tr>
305                 [% IF ( itemsloop ) %]<th class="checkall">&nbsp;</th>[% END %]
306
307                 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
308                 <th>
309                     <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&amp;sort=title&amp;direction=[% IF sort != 'title' %]asc[% ELSE %][% new_direction %][% END %]">Title</a>
310                     [% IF sort == 'title' %]
311                         <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
312                     [% ELSE %]
313                         <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
314                     [% END %]
315                 </th>
316                 <th>
317                     <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&amp;sort=author&amp;direction=[% IF sort != 'author' %]asc[% ELSE %][% new_direction %][% END %]">Author</a>
318                    [% IF sort == 'author' %]
319                         <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
320                    [% ELSE %]
321                        <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
322                    [% END %]
323                  </th>
324                 <th>Date added</th>
325                 <th>
326                     <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&amp;sort=itemcallnumber&amp;direction=[% IF sort != 'itemcallnumber' %]asc[% ELSE %][% new_direction %][% END %]">Call number</a>
327                    [% IF sort == 'itemcallnumber' %]
328                         <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
329                    [% ELSE %]
330                        <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
331                    [% END %]
332                  </th>
333             </tr>
334                 [% FOREACH itemsloo IN itemsloop %]
335                         [% UNLESS ( loop.odd ) %]
336                         <tr class="highlight">
337                         [% ELSE %]
338                         <tr>
339                         [% END %]
340                         [% IF ( itemsloop ) %]
341                         <td>
342                                 [% IF ( itemsloo.confirm ) %]
343                                 <input type="hidden"   name="CONFIRM-[% itemsloo.confirm %]" />
344                                 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="REM-[% itemsloo.biblionumber %]" checked />
345                                 [% ELSE %]
346                                 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="REM-[% itemsloo.biblionumber %]" />
347                                 [% END %]
348                         </td>
349                         [% END %]
350                         [% UNLESS ( item_level_itypes ) %]<td>
351                 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />[% END %][% itemsloo.description %]
352                         </td>[% END %]
353                         <td>
354                 [% IF ( itemsloo.XSLTBloc ) %]
355                     [% itemsloo.XSLTBloc %]
356                 [% ELSE %]
357                     [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %]
358                     [% itemsloo.title |html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield %][% END %]</a>
359                 [% END %]
360                     <p class="hold">
361                         [% IF ( itemsloo.notforloan ) %]
362                             <span class="noholdstext">No holds allowed</span>
363                         [% ELSE %]
364                             [% IF ( itemsloo.ITEM_RESULTS.size ) %]
365                                 <a id="reserve_[% itemsloo.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]">Holds</a>
366                                 [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]&amp;findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %]
367                             [% ELSE %]
368                                 <span class="noholdstext">No holds allowed</span>
369                             [% END %]
370                         [% END %]
371                         [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
372                             | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber %]">Edit record</a>
373                         [% END %]
374                         [% IF ( CAN_user_editcatalogue_edit_items ) %]
375                             | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber %]">Edit items</a>
376                         [% END %]
377                     </p>
378                         </td>
379                         <td>[% itemsloo.author %]</td>
380                         <td>[% itemsloo.dateadded %]</td>
381                         <td>
382                 <ul>
383                 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
384                     <li>[% result.holdingbranch %] [% IF ( result.location_intranet ) %] ([% result.location_intranet %]) [% END %]
385                         [% IF ( result.itemcallnumber ) %]
386                             [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber %]</a>]
387                         [% END %]
388                     </li>
389                 [% END %]
390                 </ul>
391             </td>
392                         </tr>
393                 [% END %]<!-- /itemsloop -->
394     </table>
395     <div class="pages">[% pagination_bar %]</div>
396 </form>
397
398         [% END %]
399    </div>
400 [% END %]<!-- /viewshelf -->
401
402 [% IF ( allowaddingitem ) %]
403 <div class="yui-g">
404 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
405  <fieldset class="brief">
406     <legend>Add an item to <i>[% shelfname | html %]</i></legend>
407         <ol>
408             <li>
409                 <label for="addbarcode">Barcode:</label>
410                 <input name="addbarcode" type="text" id="addbarcode" size="14" />
411                 <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
412                 <input type="hidden" name="modifyshelfcontents" value="1" />
413                 <input type="submit" value="Add" />
414             </li>
415         </ol>
416  </fieldset>
417 </form>
418 </div>
419 [% END %]<!-- /allowaddingitem -->
420
421 [% IF ( debug ) %]
422   [% IF ( edit ) %]<div>Edit is on ([% shelfname | html %])</div>[% END %]
423   [% IF ( seflag ) %]<div>seflag is on ([% seflag %])</div>[% END %]
424 [% END %]
425
426 [% IF ( seflag ) %]
427 <div class="yui-ge">
428     <div class="yui-u first">
429     <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
430         <fieldset class="rows">
431
432     [% IF ( shelves ) %]
433         <legend>Create a new list</legend>
434         <input type="hidden" name="shelves" value="1" />
435         <ol>
436         <li><label class="required" for="addshelf">List name:</label><input id="addshelf" type="text" name="addshelf" size="25" required="required" class="required" />
437             <span class="required">Required</span>
438         </li>
439         <li><span class="label">Owner: </span><input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />[% loggedinusername %]</li>
440         <li><label for="sortfield" >Sort this list by: </label>
441         <select name="sortfield" id="sortfield">
442             <option value="title">Title</option>
443             <option value="author">Author</option>
444             <option value="copyrightdate">Copyrightdate</option>
445             <option value="itemcallnumber">Call number</option>
446         </select></li>
447         <li><label for="category">Category: </label>
448             <select name="category" id="category">
449                   <option value="1">Private</option>
450                   <option value="2">Public</option>
451                      </select></li>
452             [% INCLUDE list_permissions %]
453         </ol>
454     [% END %]
455
456     [% IF ( edit ) %]
457         <legend>Edit list <i>[% shelfname | html %]</i></legend>
458         <input type="hidden" name="display" value="[% display %]" />
459         <input type="hidden" name="op" value="modifsave" />
460         [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
461         <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
462                 <ol>
463             <li><label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelfname |html %]" required="required" class="required" />
464             <span class="required">Required</span>
465         </li>
466                 <li><label for="owner">Owner: </label><input type="hidden" id="owner" name="owner" value="[% IF ( owner ) %][% ownername %][% ELSE %][% loggedinusername %][% END %]" />[% IF ( owner ) %][% ownername %][% ELSE %][% loggedinusername %][% END %]</li>
467                 <li><label for="sortfield" >Sort this list by: </label>
468                 <select name="sortfield">
469         [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
470         [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
471         [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
472         [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
473                 </select></li>
474                 <li><label for="category">Category: </label>
475                         <select id="category" name="category">
476                         [% IF ( category1 ) %]
477                                 <option value="1" selected="selected">Private</option>
478                         [% ELSE %]
479                                 <option value="1">Private</option>
480                         [% END %]
481                         [% IF ( category2 ) %]
482                                 <option value="2" selected="selected">Public</option>
483                         [% ELSE %]
484                                 <option value="2">Public</option>
485                         [% END %]
486                        </select></li>
487             [% INCLUDE list_permissions %]
488             </ol>
489         [% END %]
490
491                 </fieldset>
492
493     <fieldset class="action"><input type="submit" value="Save" class="submit" />
494         [% IF ( showprivateshelves ) %]
495             <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves" class="cancel">Cancel</a>
496         [% ELSE %]
497             [% IF ( display == "viewshelf" ) %]
498                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]" class="cancel">Cancel</a>
499             [% ELSE %]
500                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl" class="cancel">Cancel</a>
501             [% END %]
502         [% END %]
503     </fieldset>
504     </form>
505     </div>
506     <div class="yui-u">
507         <div class="help"><ul>
508             <li><b>Private list:</b> Is managed by you and can be seen only by you.</li>
509             <li><b>Public list:</b> Can be seen by everybody, but managed only by you.</li>
510             <li>The owner of a list is always allowed to add entries, but needs permission to remove.</li>
511         </ul>
512         </div>
513     </div>
514 </div>
515 [% END %]<!-- /seflag -->
516
517 [% UNLESS ( vseflag ) %]
518         <h2>Lists</h2>
519         <div class="statictabs">
520         <ul>
521         [% IF ( showprivateshelves ) %]
522             <li id="privateshelves_tab" class="active"><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a></li>
523         [% ELSE %]
524             <li id="privateshelves_tab" class=""><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a></li>
525         [% END %]
526         [% IF ( showpublicshelves ) %]
527             <li id="publicshelves_tab" class="active"><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a></li>
528         [% ELSE %]
529             <li id="publicshelves_tab" class=""><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a></li>
530         [% END %]
531         </ul>
532         [% IF ( showprivateshelves ) %]
533         <div id="privateshelves" class="tabs-container" style="display:block;">
534                 [% ELSE %]
535         <div id="privateshelves" class="tabs-container" style="display:none;">
536                 [% END %]
537             [% IF ( shelveslooppriv ) %]
538                         <div class="pages">[% pagination_bar %]</div>
539                         <table>
540                         <tr><th>List Name</th><th>Contents</th><th>Sort by</th><th>Type</th><th>Options</th></tr>
541                 [% FOREACH shelveslooppri IN shelveslooppriv %]
542                     [% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
543         <td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&amp;shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
544         <td>[% shelveslooppri.count %] item(s)</td>
545         <td>[% IF ( shelveslooppri.sortfield == "author" ) %]Author[% ELSIF ( shelveslooppri.sortfield == "copyrightdate" ) %]Year[% ELSIF (shelveslooppri.sortfield == "itemcallnumber") %]Call number[% ELSE %]Title[% END %]</td>
546         <td>[% IF ( shelveslooppri.viewcategory1 ) %][% IF !shelveslooppri.shares %]Private[% ELSE %]Shared[% END %][% END %]
547                         [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
548                 </td>
549         <td>
550             [% IF ( shelveslooppri.mine ) %]
551                                 <form action="merge.pl" method="get">
552                                         <input type="hidden" name="shelf" value="[% shelveslooppri.shelf %]" />
553                                 </form>
554                                 <form action="shelves.pl" method="get">
555                                         <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
556                                         <input type="hidden" name="op" value="modif" />
557                     <input type="hidden" name="display" value="privateshelves" />
558                                         <input type="submit" class="editshelf" value="Edit" />
559                                 </form>
560                                 <form action="shelves.pl" method="post">
561                                     <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
562                                         <input type="hidden" name="shelves" value="1" />
563                     <input type="hidden" name="display" value="privateshelves" />
564                                         <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
565                                         [% IF ( shelveslooppri.confirm ) %]
566                                         <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
567                                         <input type="submit" class="approve" value="Confirm" />
568                                         [% ELSE %]
569                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
570                                         [% END %]
571                                 </form>
572                         [% ELSE %]
573                                 None
574                         [% END %]
575                 </td>
576                 </tr>
577                 [% END %]
578         </table>
579             [% ELSE %]
580             <p>No private lists.</p>
581             [% END %]<!-- /shelveslooppriv -->
582                 </div><!-- /privateshelves -->
583
584         [% IF ( showpublicshelves ) %]
585         <div id="publicshelves" class="tabs-container" style="display:block;">
586                 [% ELSE %]
587         <div id="publicshelves" class="tabs-container" style="display:none;">
588                 [% END %]
589         [% IF ( shelvesloop ) %]
590                 <div class="pages">[% pagination_bar %]</div>
591         <table>
592         <tr><th>List Name</th><th>Created by</th><th>Contents</th><th>Sort By</th><th>Type</th><th>Options</th></tr>
593             [% FOREACH shelvesloo IN shelvesloop %]
594                 [% IF ( shelvesloo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
595                 <td><a href="shelves.pl?viewshelf=[% shelvesloo.shelf %]">[% shelvesloo.shelfname |html %]</a></td>
596         <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% shelvesloo.owner %]">[% shelvesloo.ownername %]</td>
597                 <td>[% shelvesloo.count %] item(s)</td>
598         <td>[% IF ( shelvesloo.sortfield == "author" ) %]Author[% ELSIF ( shelvesloo.sortfield == "copyrightdate" ) %]Year[% ELSIF (shelvesloo.sortfield == "itemcallnumber") %]Call number[% ELSE %]Title[% END %]</td>
599         <td>[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
600                         [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
601                 </td>
602         <td>
603             [% IF ( shelvesloo.manageshelf ) %]
604                                 <form action="shelves.pl" method="get">
605                                         <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
606                                         <input type="hidden" name="op" value="modif" />
607                                         <input type="submit" class="editshelf" value="Edit" />
608                                 </form>
609                                 <form action="shelves.pl" method="post">
610                                         <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
611                                         <input type="hidden" name="shelves" value="1" />
612                                         <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
613                                         [% IF ( shelvesloo.confirm ) %]
614                                         <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
615                                         <input type="submit" class="approve" value="Confirm" />
616                                         [% ELSE %]
617                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
618                                         [% END %]
619                                 </form>
620                         [% ELSE %]
621                                 None
622                         [% END %]
623                 </td>
624                 </tr>
625             [% END %]
626         </table>
627         [% ELSE %]
628             [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
629         [% END %]<!-- /shelvesloop -->
630         </div><!-- /publicshelves -->
631                 </div>
632 [% END %]
633
634 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
635     <!-- Value will be set here by placeHold() -->
636     <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
637     <input type="hidden" name="multi_hold" value="1"/>
638 </form>
639
640 </div>
641 </div>
642 [% INCLUDE 'intranet-bottom.inc' %]