3 [% USE AuthorisedValues %]
5 [% USE TablesSettings %]
9 [% PROCESS 'i18n.inc' %]
10 [% SET footerjs = 1 %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>[% FILTER collapse %]
13 [% t("Lost items") | html %] ›
14 [% t("Reports") | html %] ›
15 [% t("Koha") | html %]
17 [% INCLUDE 'doc-head-close.inc' %]
20 <body id="rep_itemslost" class="rep">
21 [% WRAPPER 'header.inc' %]
22 [% INCLUDE 'cat-search.inc' %]
25 [% WRAPPER 'sub-header.inc' %]
26 [% WRAPPER breadcrumbs %]
27 [% WRAPPER breadcrumb_item %]
28 <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
30 [% IF ( get_items ) %]
31 [% WRAPPER breadcrumb_item %]
32 <a href="/cgi-bin/koha/reports/itemslost.pl">Lost items</a>
34 [% WRAPPER breadcrumb_item bc_active= 1 %]
38 [% WRAPPER breadcrumb_item bc_active= 1 %]
39 <span>Lost items</span>
42 [% END #/ WRAPPER breadcrumbs %]
43 [% END #/ WRAPPER sub-header.inc %]
45 <div class="main container-fluid">
47 <div class="col-sm-10 col-sm-push-2">
53 [% IF ( get_items ) %]
56 [% IF csv_profiles.count %]
57 <div class="lostitems-table_table_controls">
58 | <a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> |
59 <a href="#" class="ClearAll"><i class="fa fa-times"></i> Clear all</a>
60 <span class="itemselection_actions">
62 <a class="itemselection_action_export"><i class="fa fa-download"></i> Export selected items</a>
63 Using the following CSV profile:
64 <select name="csv_profile_id" id="csv_profile_id">
65 [% FOREACH csv_profile IN csv_profiles %]
66 <option value="[% csv_profile.export_format_id | html %]">
67 [% csv_profile.profile | html %]
74 <div class="dialog message">
75 [% IF ( CAN_user_tools_manage_csv_profiles ) %]
76 <span>To enable the export of selected items, <a href="/cgi-bin/koha/tools/csv-profiles.pl">create a CSV profile</a> of the type "SQL" with usage option "Export lost items in report."</span>
78 <span>To enable the export of selected items, your administrator must create a CSV profile of the type "SQL" with usage option "Export lost items in report."</span>
81 <div class="lostitems-table_table_controls">
85 <table id="lostitems-table">
88 [% IF csv_profiles.count %]
89 <th class="NoSort"></th>
97 <th>Date last seen</th>
103 <th>Current library</th>
105 <th>Not for loan status</th>
110 [% FOREACH item IN items %]
112 [% IF csv_profiles.count %]
113 <td style="text-align:center;vertical-align:middle">
114 <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
118 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.biblio.title | html %]</a>
120 <td>[% item.biblio.author | html %]</td>
121 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) | html %]
122 <td data-order="[% item.itemlost_on | html %]">[% item.itemlost_on | $KohaDates %]</td>
124 <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.barcode | html %]</a>
126 <td>[% item.itemcallnumber | html %]</td>
127 <td data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
128 <td>[% item.price | $Price %]</td>
129 <td>[% item.replacementprice | $Price %]</td>
130 <td>[% Branches.GetName(item.homebranch) | html %]</td>
131 <td>[% ItemTypes.GetDescription(item.effective_itemtype) | html %]</td>
132 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
133 <td>[% Branches.GetName(item.holdingbranch) | html %]</td>
134 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</td>
135 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]
136 <td>[% item.itemnotes | $raw %]</td>
144 <form name="f" action="/cgi-bin/koha/reports/itemslost.pl" method="post">
145 <fieldset class="rows">
148 <li><label for="barcodefilter">Barcode: </label><input type="text" name="barcodefilter" id="barcodefilter" size="6" /></li>
149 <li><label for="branchfilter">Library: </label><select name="branchfilter" id="branchfilter">
150 <option value="">All</option>
151 [% PROCESS options_for_libraries libraries => Branches.all() %]
153 <li><label for="itemtypesfilter">Item type: </label><select name="itemtypesfilter" id="itemtypesfilter">
154 <option value="">All</option>
155 [% FOREACH itemtype IN itemtypes %]
156 <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
161 <label for="loststatusfilter">Lost status: </label>
162 <select name="loststatusfilter" id="loststatusfilter">
163 <option value="">All</option>
164 [% FOREACH l IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.itemlost') %]
165 [% IF l.authorised_value == lostfilter %]
166 <option value="[% l.authorised_value | html %]" selected="selected">[% l.lib | html %]</option>
168 <option value="[% l.authorised_value | html %]">[% l.lib | html %]</option>
175 <label for="notforloanfilter">Not for loan: </label>
176 <select name="notforloanfilter" id="notforloanfilter">
177 <option value="">All</option>
178 [% FOREACH n IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.notforloan') %]
179 [% IF n.authorised_value == notforloanfilter %]
180 <option value="[% n.authorised_value | html %]" selected="selected">[% n.lib | html %]</option>
182 <option value="[% n.authorised_value | html %]">[% n.lib | html %]</option>
189 <fieldset class="action"> <input type="submit" class="btn btn-primary" value="Submit" />
190 <input type="hidden" name="get_items" value="1" /></fieldset>
196 </div> <!-- /.col-sm-10.col-sm-push-2 -->
198 <div class="col-sm-2 col-sm-pull-10">
200 [% INCLUDE 'reports-menu.inc' %]
202 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
203 </div> <!-- /.row -->
205 [% MACRO jsinclude BLOCK %]
206 [% INCLUDE 'datatables.inc' %]
207 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
208 [% INCLUDE 'columns_settings.inc' %]
209 [% Asset.js("js/table_filters.js") | $raw %]
211 $(document).ready(function() {
212 var table_settings = [% TablesSettings.GetTableSettings( 'reports', 'lostitems', 'lostitems-table', 'json' ) | $raw %];
213 [% IF csv_profiles.count %]
214 // Add the first (checkbox) column if it is displayed
215 table_settings['columns'].unshift({cannot_be_modified: 1, cannot_be_toggled: 1, columnname: 'itemnumber', is_hidden: 0});
218 var lostitems_table = KohaTable("lostitems-table", {
221 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
225 }, table_settings, 'with_filters');
227 function itemSelectionBuildExportLink() {
228 var itemnumbers = new Array();
229 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
230 itemnumbers.push($(this).val());
232 if (itemnumbers.length > 0) {
233 var csv_profile_id = $("#csv_profile_id option:selected").val();
234 var url = '/cgi-bin/koha/reports/itemslost.pl?op=export&csv_profile_id='+csv_profile_id;
235 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
236 $('a.itemselection_action_export').attr('href', url);
243 function itemSelectionBuildActionLinks() {
244 var export_link_ok = itemSelectionBuildExportLink();
245 if (export_link_ok) {
246 $('.itemselection_actions').show();
248 $('.itemselection_actions').hide();
252 itemSelectionBuildActionLinks();
254 $("input[name='itemnumber'][type='checkbox']").change(function() {
255 itemSelectionBuildActionLinks();
257 $("#csv_profile_id").change(function() {
258 itemSelectionBuildActionLinks();
261 $(".SelectAll").on("click",function(e){
263 $("#lostitems-table input:checkbox").each(function(){
264 $(this).prop("checked", true);
266 itemSelectionBuildActionLinks();
269 $(".ClearAll").on("click",function(e){
271 $("#lostitems-table input:checkbox").each(function(){
272 $(this).prop("checked", false);
274 itemSelectionBuildActionLinks();
280 [% INCLUDE 'intranet-bottom.inc' %]