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