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