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