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