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