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