Bug 9573: Lost items report - Add items.notforloan as a filter
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / itemslost.tt
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>
11
12 <body id="rep_itemslost" class="rep">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
15
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>
17
18 <div id="doc3" class="yui-t2">
19    
20    <div id="bd">
21         <div id="yui-main">
22         <div class="yui-b">
23
24 <h1>Lost items</h1>
25
26 [% IF ( get_items ) %]
27
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>
35
36     [% IF items.count %]
37         <table id="lostitems-table">
38             <thead>
39                 <tr>
40                     <th>Title</th>
41                     <th>Author</th>
42                     <th>Lost code</th>
43                     <th>Barcode</th>
44                     <th>Call number</th>
45                     <th>Date last seen</th>
46                     <th>Price</th>
47                     <th>Rep.price</th>
48                     <th>Library</th>
49                     <th>Item type</th>
50                     <th>Current location</th>
51                     <th>Location</th>
52                     <th>Not for loan status</th>
53                     <th>Notes</th>
54                 </tr>
55             </thead>
56             <tbody>
57                 [% FOREACH item IN items %]
58                     <tr>
59                         <td>
60                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
61                         </td>
62                         <td>[% item.biblio.author %]</td>
63                         <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
64                         <td>
65                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
66                         </td>
67                         <td>[% item.itemcallnumber %]</td>
68                         <td>[% item.datelastseen | $KohaDates %]</td>
69                         <td>[% item.price %]</td>
70                         <td>[% item.replacementprice %]</td>
71                         <td>[% Branches.GetName(item.homebranch) %]</td>
72                         <td>[% item.effective_itemtype %]</td>
73                         <td>[% Branches.GetName(item.holdingbranch) %]</td>
74                         <td>[% item.location %]</td>
75                         <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
76                         <td>[% item.itemnotes %]</td>
77                     </tr>
78                 [% END %]
79             </tbody>
80         </table>
81     [% END %]
82         [% ELSE %]
83         
84         <form name="f" action="/cgi-bin/koha/reports/itemslost.pl" method="post">
85     <fieldset class="rows">
86         <ol>
87
88         <li><label for="barcodefilter">Barcode: </label><input type="text" name="barcodefilter" id="barcodefilter" size="6" /></li>
89         <li><label for="branchfilter">Library: </label><select name="branchfilter" id="branchfilter">
90                 <option value="">All</option>
91                 [% PROCESS options_for_libraries libraries => Branches.all() %]
92             </select></li>
93     <li><label for="itemtypesfilter">Item type: </label><select name="itemtypesfilter" id="itemtypesfilter">
94                 <option value="">All</option>
95                 [% FOREACH itemtype IN itemtypes %]
96                     <option value="[% itemtype.itemtype  %]">[% itemtype.translated_description %]</option>
97                 [% END %]
98             </select></li>
99
100     <li>
101         <label for="loststatusfilter">Lost status: </label>
102         <select name="loststatusfilter" id="loststatusfilter">
103             <option value="">All</option>
104             [% FOREACH l IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.itemlost') %]
105                 [% IF l.authorised_value == lostfilter %]
106                     <option value="[% l.authorised_value %]" selected="selected">[% l.lib %]</option>
107                 [% ELSE %]
108                     <option value="[% l.authorised_value %]">[% l.lib %]</option>
109                 [% END %]
110             [% END %]
111         </select>
112     </li>
113
114     <li>
115         <label for="notforloanfilter">Not for loan: </label>
116         <select name="notforloanfilter" id="notforloanfilter">
117             <option value="">All</option>
118             [% FOREACH n IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.notforloan') %]
119                 [% IF n.authorised_value == notforloanfilter %]
120                     <option value="[% n.authorised_value %]" selected="selected">[% n.lib %]</option>
121                 [% ELSE %]
122                     <option value="[% n.authorised_value %]">[% n.lib %]</option>
123                 [% END %]
124             [% END %]
125         </select>
126     </li>
127
128 </ol></fieldset>
129 <fieldset class="action">    <input type="submit" value="Submit" />
130     <input type="hidden" name="get_items" value="1" /></fieldset>
131 </form>
132         
133         [% END %]
134
135 </div>
136 </div>
137 <div class="yui-b">
138 [% INCLUDE 'reports-menu.inc' %]
139 </div>
140 </div>
141
142 [% MACRO jsinclude BLOCK %]
143     [% INCLUDE 'datatables.inc' %]
144     [% INCLUDE 'columns_settings.inc' %]
145     <script type='text/javascript'>
146         $(document).ready(function() {
147             var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
148             var lostitems_table = KohaTable("#lostitems-table", {
149                 "dom": 'B<"clearfix">t',
150                 "aaSorting": [],
151                 "aoColumnDefs": [
152                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
153                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
154                 ],
155                 "bPaginate": false,
156             }, columns_settings);
157
158         });
159     </script>
160 [% END %]
161
162 [% INCLUDE 'intranet-bottom.inc' %]