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