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