Bug 20774: Trivial HTML error in itemslost.tt
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / itemslost.tt
1 [% USE Asset %]
2 [% USE AuthorisedValues %]
3 [% USE Branches %]
4 [% USE ColumnsSettings %]
5 [% USE KohaDates %]
6 [% USE ItemTypes %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Reports &rsaquo; Lost items</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/datatables.css") %]
12 </head>
13
14 <body id="rep_itemslost" class="rep">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'cat-search.inc' %]
17
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>[% IF ( get_items ) %] &rsaquo; <a href="/cgi-bin/koha/reports/itemslost.pl">Lost items</a> &rsaquo; Results[% ELSE %] &rsaquo; Lost items[% END %]</div>
19
20 <div id="doc3" class="yui-t2">
21    
22    <div id="bd">
23         <div id="yui-main">
24         <div class="yui-b">
25
26 <h1>Lost items</h1>
27
28 [% IF ( get_items ) %]
29
30 <div class="results">
31     [% IF items.count%]
32         [% items.count %] lost items found
33     [% ELSE %]
34         No lost items found
35     [% END %]
36 </div>
37
38     [% IF items.count %]
39         <div class="lostitems-table_table_controls">
40                 | <a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> |
41                 <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
42                 <span class="itemselection_actions">
43                   | Actions:
44                   [% IF csv_profiles.count %]
45                       <a class="itemselection_action_export"><i class="fa fa-download"></i> Export selected items</a>
46                       Using the following CSV profile:
47                       <select name="csv_profile_id" id="csv_profile_id">
48                           [% FOREACH csv_profile IN csv_profiles %]
49                               <option value="[% csv_profile.export_format_id %]">[% csv_profile.profile %]</<option>
50                           [% END %]
51                       </select>
52                   [% ELSE %]
53                       <span class="itemselection_action_export" title="You should create a CSV profile for export_lost_items"><i class="fa fa-download"></i> Export selected items</a>
54                   [% END %]
55                 </span>
56         </div>
57
58         <table id="lostitems-table">
59             <thead>
60                 <tr>
61                     <th class="NoSort"></th>
62                     <th>Title</th>
63                     <th>Author</th>
64                     <th>Lost status</th>
65                     <th class="title-string">Lost on</th>
66                     <th>Barcode</th>
67                     <th>Call number</th>
68                     <th class="title-string">Date last seen</th>
69                     <th>Price</th>
70                     <th>Rep.price</th>
71                     <th>Library</th>
72                     <th>Item type</th>
73                     <th>Current location</th>
74                     <th>Location</th>
75                     <th>Not for loan status</th>
76                     <th>Notes</th>
77                 </tr>
78             </thead>
79             <tbody>
80                 [% FOREACH item IN items %]
81                     <tr>
82                         <td style="text-align:center;vertical-align:middle">
83                             <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" />
84                         </td>
85                         <td>
86                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
87                         </td>
88                         <td>[% item.biblio.author %]</td>
89                         <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
90                         <td><span title="[% item.itemlost_on %]">[% item.itemlost_on | $KohaDates %]</span></td>
91                         <td>
92                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
93                         </td>
94                         <td>[% item.itemcallnumber %]</td>
95                         <td><span title="[% item.datelastseen %]">[% item.datelastseen | $KohaDates %]</span></td>
96                         <td>[% item.price %]</td>
97                         <td>[% item.replacementprice %]</td>
98                         <td>[% Branches.GetName(item.homebranch) %]</td>
99                         <td>[% ItemTypes.GetDescription(item.effective_itemtype) %]</td>
100                         <td>[% Branches.GetName(item.holdingbranch) %]</td>
101                         <td>[% AuthorisedValues.GetByCode( 'LOC', item.location )%]</td>
102                         <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
103                         <td>[% item.itemnotes %]</td>
104                     </tr>
105                 [% END %]
106             </tbody>
107         </table>
108     [% END %]
109         [% ELSE %]
110         
111         <form name="f" action="/cgi-bin/koha/reports/itemslost.pl" method="post">
112     <fieldset class="rows">
113         <ol>
114
115         <li><label for="barcodefilter">Barcode: </label><input type="text" name="barcodefilter" id="barcodefilter" size="6" /></li>
116         <li><label for="branchfilter">Library: </label><select name="branchfilter" id="branchfilter">
117                 <option value="">All</option>
118                 [% PROCESS options_for_libraries libraries => Branches.all() %]
119             </select></li>
120     <li><label for="itemtypesfilter">Item type: </label><select name="itemtypesfilter" id="itemtypesfilter">
121                 <option value="">All</option>
122                 [% FOREACH itemtype IN itemtypes %]
123                     <option value="[% itemtype.itemtype  %]">[% itemtype.translated_description %]</option>
124                 [% END %]
125             </select></li>
126
127     <li>
128         <label for="loststatusfilter">Lost status: </label>
129         <select name="loststatusfilter" id="loststatusfilter">
130             <option value="">All</option>
131             [% FOREACH l IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.itemlost') %]
132                 [% IF l.authorised_value == lostfilter %]
133                     <option value="[% l.authorised_value %]" selected="selected">[% l.lib %]</option>
134                 [% ELSE %]
135                     <option value="[% l.authorised_value %]">[% l.lib %]</option>
136                 [% END %]
137             [% END %]
138         </select>
139     </li>
140
141     <li>
142         <label for="notforloanfilter">Not for loan: </label>
143         <select name="notforloanfilter" id="notforloanfilter">
144             <option value="">All</option>
145             [% FOREACH n IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.notforloan') %]
146                 [% IF n.authorised_value == notforloanfilter %]
147                     <option value="[% n.authorised_value %]" selected="selected">[% n.lib %]</option>
148                 [% ELSE %]
149                     <option value="[% n.authorised_value %]">[% n.lib %]</option>
150                 [% END %]
151             [% END %]
152         </select>
153     </li>
154
155 </ol></fieldset>
156 <fieldset class="action">    <input type="submit" value="Submit" />
157     <input type="hidden" name="get_items" value="1" /></fieldset>
158 </form>
159         
160         [% END %]
161
162 </div>
163 </div>
164 <div class="yui-b">
165 [% INCLUDE 'reports-menu.inc' %]
166 </div>
167 </div>
168
169 [% MACRO jsinclude BLOCK %]
170     [% INCLUDE 'datatables.inc' %]
171     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") %]
172     [% INCLUDE 'columns_settings.inc' %]
173     [% Asset.js("js/table_filters.js") %]
174     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
175     <script type='text/javascript'>
176         $(document).ready(function() {
177             var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
178             var lostitems_table = KohaTable("lostitems-table", {
179                 "dom": 'B<"clearfix">t',
180                 "aaSorting": [],
181                 "aoColumnDefs": [
182                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
183                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
184                 ],
185                 'bAutoWidth': false,
186                 "bPaginate": false,
187             }, columns_settings, 'with_filters');
188
189             function itemSelectionBuildExportLink() {
190                 var itemnumbers = new Array();
191                 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
192                     itemnumbers.push($(this).val());
193                 });
194                 if (itemnumbers.length > 0) {
195                     var csv_profile_id = $("#csv_profile_id  option:selected").val();
196                     var url = '/cgi-bin/koha/reports/itemslost.pl?op=export&csv_profile_id='+csv_profile_id;
197                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
198                     $('a.itemselection_action_export').attr('href', url);
199                 } else {
200                     return false;
201                 }
202                 return true;
203             }
204
205             function itemSelectionBuildActionLinks() {
206                 var export_link_ok = itemSelectionBuildExportLink();
207                 if (export_link_ok) {
208                     $('.itemselection_actions').show();
209                 } else {
210                     $('.itemselection_actions').hide();
211                 }
212             }
213
214             itemSelectionBuildActionLinks();
215
216             $("input[name='itemnumber'][type='checkbox']").change(function() {
217                 itemSelectionBuildActionLinks();
218             });
219             $("#csv_profile_id").change(function() {
220                 itemSelectionBuildActionLinks();
221             });
222
223             $(".SelectAll").on("click",function(e){
224                 e.preventDefault();
225                 $("#lostitems-table").checkCheckboxes();
226                 itemSelectionBuildActionLinks();
227             });
228
229             $(".ClearAll").on("click",function(e){
230                 e.preventDefault();
231                 $("#lostitems-table").unCheckCheckboxes();
232                 itemSelectionBuildActionLinks();
233             });
234         });
235     </script>
236 [% END %]
237
238 [% INCLUDE 'intranet-bottom.inc' %]