ea5812a3ad1363bf8f86238a47cfa121bb9cbb98
[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="doc3" class="yui-t2">
306 <div id="bd">
307 <div id="yui-main">
308 <div class="yui-b">
309
310    <div class="yui-g">[% INCLUDE 'virtualshelves-toolbar.inc' %]
311    </div>
312
313 [% FOR m IN messages %]
314     <div class="dialog [% m.type %]">
315         [% SWITCH m.code %]
316         [% CASE 'error_on_update' %]
317             An error occurred when updating this list. Perhaps the value already exists.
318         [% CASE 'error_on_insert' %]
319             An error occurred when inserting this list. Perhaps the name already exists.
320         [% CASE 'error_on_delete' %]
321             An error occurred when deleteing this list. Check the logs.
322         [% CASE 'success_on_update' %]
323             List updated with success.
324         [% CASE 'success_on_insert' %]
325             List inserted with success.
326         [% CASE 'success_on_delete' %]
327             List deleted with success.
328         [% CASE 'Koha::Exception::DuplicateObject' %]
329             An error occurred when inserting this list. The name already [% shelfname %] exists.
330         [% CASE %]
331             [% m.code %]
332         [% END %]
333     </div>
334 [% END %]
335
336 [% IF ( paramsloop ) %]
337 [% FOREACH paramsloo IN paramsloop %]
338 <div class="yui-ge">
339     <div class="yui-u first">
340                 [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
341                 [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] 
342         [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No list number given.</div>[% END %]
343                 [% IF ( paramsloo.need_confirm ) %]
344                 <div class="dialog alert">The list <i>[% paramsloo.need_confirm %]</i> is not empty.
345             [% IF ( paramsloo.single ) %]
346                 <br />It has <b>[% paramsloo.count %]</b> entry.
347             [% ELSE %]
348                 <br />It has <b>[% paramsloo.count %]</b> entries.
349             [% END %]
350                         <br />Use the "Confirm" button below to confirm deletion.
351                 </div>
352                 [% END %]
353                 [% IF ( paramsloo.nopermission ) %]
354                 <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div>
355                 [% END %]
356                 [% IF ( paramsloo.failgetitem ) %]
357                 <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
358                 [% END %] 
359                 [% IF ( paramsloo.duplicatebiblio ) %]
360                 <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
361                 [% END %]
362                 [% IF ( paramsloo.nothingdeleted) %]
363                       <div class="dialog message">Warning: You could not delete any of the selected items from this list.</div>
364                 [% END %]
365                 [% IF ( paramsloo.somedeleted) %]
366                       <div class="dialog message">Warning: You could not delete all selected items from this list.</div>
367                 [% END %]
368                 [% IF ( paramsloo.modifyfailure) %]
369                       <div class="dialog message">ERROR: List could not be modified.</div>
370                 [% END %]
371         </div>
372 </div>
373 [% END %]
374 [% END %] 
375
376 [% IF ( viewshelf ) %]
377    <div class="yui-g">
378     [% IF ( itemsloop ) %]
379
380     <h3>Contents of <i>[% shelfname | html %]</i></h3>
381     <div class="pages">[% pagination_bar %]</div>
382     <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
383         <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
384         <input type="hidden" name="modifyshelfcontents" value="1" />
385
386 [% IF direction == 'asc' %]
387     [% SET new_direction = 'desc' %]
388 [% ELSE %]
389     [% SET direction = 'desc' %]
390     [% SET new_direction = 'asc' %]
391 [% END %]
392
393 <div id="searchheader" class="noprint">
394     [% IF ( itemsloop ) %]
395         <div id="selection_ops"><span class="checkall"></span> |
396         <span class="clearall"></span>
397
398         <span class="addto">| </span>
399         &nbsp;
400         [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %]
401             <div class="btn-group"><button class="btn btn-mini placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button></div>
402         [% END %]
403         [% IF ( allowremovingitems ) %]
404             <div class="btn-group"><button type="submit" class="btn btn-mini list-remove"><i class="fa fa-times-circle"></i> Remove selected</button></div>
405         [% END %]
406         [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<div class="btn-group"><button type="submit" class="btn btn-mini merge-items"><i class="fa fa-compress"></i> Merge selected</button></div>[% END %]
407         </div>
408     [% END %]
409 </div>
410
411     <table id="searchresults">
412             <tr>
413                 [% IF ( itemsloop ) %]<th class="checkall">&nbsp;</th>[% END %]
414
415                 [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
416                 <th>
417                     <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>
418                     [% IF sort == 'title' %]
419                         <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
420                     [% ELSE %]
421                         <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
422                     [% END %]
423                 </th>
424                 <th>
425                     <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>
426                    [% IF sort == 'author' %]
427                         <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
428                    [% ELSE %]
429                        <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
430                    [% END %]
431                  </th>
432                 <th>Date added</th>
433                 <th>
434                     <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>
435                    [% IF sort == 'itemcallnumber' %]
436                         <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
437                    [% ELSE %]
438                        <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
439                    [% END %]
440                  </th>
441             </tr>
442                 [% FOREACH itemsloo IN itemsloop %]
443                         [% UNLESS ( loop.odd ) %]
444                         <tr class="highlight">
445                         [% ELSE %]
446                         <tr>
447                         [% END %]
448                         [% IF ( itemsloop ) %]
449                         <td>
450                                 [% IF ( itemsloo.confirm ) %]
451                                 <input type="hidden"   name="CONFIRM-[% itemsloo.confirm %]" />
452                                 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="REM-[% itemsloo.biblionumber %]" checked />
453                                 [% ELSE %]
454                                 <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="REM-[% itemsloo.biblionumber %]" />
455                                 [% END %]
456                         </td>
457                         [% END %]
458                         [% UNLESS ( item_level_itypes ) %]<td>
459                 [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />[% END %][% itemsloo.description %]
460                         </td>[% END %]
461                         <td>
462                 [% IF ( itemsloo.XSLTBloc ) %]
463                     [% itemsloo.XSLTBloc %]
464                 [% ELSE %]
465                     [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %]
466                     [% itemsloo.title |html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield %][% END %]</a>
467                 [% END %]
468                     <p class="hold">
469                         [% IF ( itemsloo.notforloan ) %]
470                             <span class="noholdstext">No holds allowed</span>
471                         [% ELSE %]
472                             [% IF ( itemsloo.ITEM_RESULTS.size ) %]
473                                 <a id="reserve_[% itemsloo.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]">Holds</a>
474                                 [% 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 %]
475                             [% ELSE %]
476                                 <span class="noholdstext">No holds allowed</span>
477                             [% END %]
478                         [% END %]
479                         [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
480                             | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber %]">Edit record</a>
481                         [% END %]
482                         [% IF ( CAN_user_editcatalogue_edit_items ) %]
483                             | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber %]">Edit items</a>
484                         [% END %]
485                     </p>
486                         </td>
487                         <td>[% itemsloo.author %]</td>
488                         <td>[% itemsloo.dateadded %]</td>
489                         <td>
490                 <ul>
491                 [% FOREACH result IN itemsloo.ITEM_RESULTS %]
492                     <li>[% result.holdingbranch %] [% IF ( result.location_intranet ) %] ([% result.location_intranet %]) [% END %]
493                         [% IF ( result.itemcallnumber ) %]
494                             [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber %]</a>]
495                         [% END %]
496                     </li>
497                 [% END %]
498                 </ul>
499             </td>
500                         </tr>
501                 [% END %]<!-- /itemsloop -->
502     </table>
503     <div class="pages">[% pagination_bar %]</div>
504 </form>
505
506         [% END %]
507    </div>
508 [% END %]<!-- /viewshelf -->
509
510 [% IF ( debug ) %]
511   [% IF ( edit ) %]<div>Edit is on ([% shelfname | html %])</div>[% END %]
512   [% IF ( seflag ) %]<div>seflag is on ([% seflag %])</div>[% END %]
513 [% END %]
514
515 [% IF ( seflag ) %]
516 <div class="yui-ge">
517     <div class="yui-u first">
518     <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
519         <fieldset class="rows">
520
521     [% IF ( shelves ) %]
522         <legend>Create a new list</legend>
523         <input type="hidden" name="shelves" value="1" />
524         <ol>
525         <li><label class="required" for="addshelf">List name:</label><input id="addshelf" type="text" name="addshelf" size="25" required="required" class="required" />
526             <span class="required">Required</span>
527         </li>
528         <li><span class="label">Owner: </span><input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />[% loggedinusername %]</li>
529         <li><label for="sortfield" >Sort this list by: </label>
530         <select name="sortfield" id="sortfield">
531             <option value="title">Title</option>
532             <option value="author">Author</option>
533             <option value="copyrightdate">Copyrightdate</option>
534             <option value="itemcallnumber">Call number</option>
535         </select></li>
536         <li><label for="category">Category: </label>
537             <select name="category" id="category">
538                   <option value="1">Private</option>
539                   <option value="2">Public</option>
540                      </select></li>
541             [% INCLUDE list_permissions %]
542         </ol>
543     [% END %]
544
545     [% IF ( edit ) %]
546         <legend>Edit list <i>[% shelfname | html %]</i></legend>
547         <input type="hidden" name="display" value="[% display %]" />
548         <input type="hidden" name="op" value="modifsave" />
549         [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
550         <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
551                 <ol>
552             <li><label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelfname |html %]" required="required" class="required" />
553             <span class="required">Required</span>
554         </li>
555                 <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>
556                 <li><label for="sortfield" >Sort this list by: </label>
557                 <select name="sortfield">
558         [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
559         [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
560         [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
561         [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
562                 </select></li>
563                 <li><label for="category">Category: </label>
564                         <select id="category" name="category">
565                         [% IF ( category1 ) %]
566                                 <option value="1" selected="selected">Private</option>
567                         [% ELSE %]
568                                 <option value="1">Private</option>
569                         [% END %]
570                         [% IF ( category2 ) %]
571                                 <option value="2" selected="selected">Public</option>
572                         [% ELSE %]
573                                 <option value="2">Public</option>
574                         [% END %]
575                        </select></li>
576             [% INCLUDE list_permissions %]
577             </ol>
578         [% END %]
579
580                 </fieldset>
581
582     <fieldset class="action"><input type="submit" value="Save" class="submit" />
583         [% IF ( showprivateshelves ) %]
584             <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves" class="cancel">Cancel</a>
585         [% ELSE %]
586             [% IF ( display == "viewshelf" ) %]
587                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]" class="cancel">Cancel</a>
588             [% ELSE %]
589                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl" class="cancel">Cancel</a>
590             [% END %]
591         [% END %]
592     </fieldset>
593     </form>
594     </div>
595     <div class="yui-u">
596         <div class="help"><ul>
597             <li><b>Private list:</b> Is managed by you and can be seen only by you.</li>
598             <li><b>Public list:</b> Can be seen by everybody, but managed only by you.</li>
599             <li>The owner of a list is always allowed to add entries, but needs permission to remove.</li>
600         </ul>
601         </div>
602     </div>
603 </div>
604 [% END %]<!-- /seflag -->
605
606 [% IF op == 'list' %]
607     <h2>Lists</h2>
608     <div id="tabs" class="toptabs">
609         <ul>
610             <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
611             <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
612         </ul>
613
614         <div id="tab_content">
615             <table id="listresultst">
616                 <thead>
617                     <tr>
618                         <th class="NoVisible">Type</th>
619                         <th>List name</th>
620                         <th>Contents</th>
621                         <th>Owner</th>
622                         <th>Sort by</th>
623                         <th>Creation date</th>
624                         <th>Modification date</th>
625                         <th>Actions</th>
626                     </tr>
627                     <tr class="filters_row">
628                         <th></th>
629                         <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
630                         <th></th>
631                         <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
632                         <th>
633                             <select class="filter text_filter" id="searchsortby_filter">
634                                 <option value=""></option>
635                                 <option value="title">Title</option>
636                                 <option value="author">Author</option>
637                                 <option value="copyrightdate">Copyrightdate</option>
638                                 <option value="itemcallnumber">Call number</option>
639                             </select>
640                         </th>
641                         <th></th>
642                         <th></th>
643                         <th></th>
644                     </tr>
645                 </thead>
646                 <tbody></tbody>
647             </table>
648         </div>
649     </div>
650 [% END %]
651
652 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
653     <!-- Value will be set here by placeHold() -->
654     <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
655     <input type="hidden" name="multi_hold" value="1"/>
656 </form>
657
658 </div>
659 </div>
660
661 [% IF ( allowaddingitem ) %]
662 <div class="yui-b">
663   <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
664     <fieldset class="brief">
665       <legend>Add an item</legend>
666       <ol>
667         <li>
668           <label for="addbarcode">Barcode:</label>
669           <input name="addbarcode" type="text" id="addbarcode" class="focus" />
670           <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
671           <input type="hidden" name="modifyshelfcontents" value="1" />
672         </li>
673       </ol>
674       <fieldset class="action">
675         <input type="submit" value="Add" />
676       </fieldset>
677     </fieldset>
678   </form>
679 </div>
680 [% END %]<!-- /allowaddingitem -->
681
682 </div>
683 [% INCLUDE 'intranet-bottom.inc' %]