Bug 7720: add options for controlling display of an item's home and/or holdings location
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / inventory.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; Inventory</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 <script type="text/javascript">
10 //<![CDATA[
11 $(document).ready(function(){
12
13         inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
14             'sPaginationType': 'full_numbers',
15             [% IF compareinv2barcd %]
16                 "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 1 ] } ]
17             [% ELSE %]
18                 "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0 ] } ]
19             [% END %]
20         } ));
21
22
23         $("#continuewithoutmarkingbutton").click(function(){
24             inventorydt.fnPageChange( 'next' );
25             return false;
26         });
27
28         $("#markseenandcontinuebutton").click(function(){
29             var param = '';
30             $("input:checked").each(function() {
31                 param += "|" + $(this).attr('name');
32             });
33             $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
34             inventorydt.fnPageChange( 'next' );
35             return false;
36         });
37
38         $("#markseenandquit").click(function(){
39             var param = '';
40             $("input:checked").each(function() {
41                 param += "|" + $(this).attr('name');
42             });
43             $.ajax({
44               type: 'POST',
45               url: '/cgi-bin/koha/tools/ajax-inventory.pl',
46               data: { seen: param},
47               async: false
48             });
49             document.location.href = '/cgi-bin/koha/tools/inventory.pl';
50             return false;
51         });
52
53
54     $(".checkall").click(function(){
55             $(".checkboxed").checkCheckboxes();
56             return false;
57         });
58     $(".clearall").click(function(){
59             $(".checkboxed").unCheckCheckboxes();
60             return false;
61         });
62     });
63 //]]>
64 </script>
65 </head>
66 <body id="tools_inventory" class="tools">
67 [% INCLUDE 'header.inc' %]
68 [% INCLUDE 'cat-search.inc' %]
69
70 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF (loop) %]<a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a> &rsaquo; Results[% ELSE %]Inventory[% END %]</div>
71
72 <div id="doc3" class="yui-t2">
73
74    <div id="bd">
75     <div id="yui-main">
76     <div class="yui-b">
77     <h1>Inventory/Stocktaking</h1>
78     [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
79     [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
80     [% FOREACH error IN errorloop %]
81         <div class="dialog alert">
82             [% error.barcode %]
83             [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
84             [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
85             [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
86             [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
87         </div>
88     [% END %]
89        [% UNLESS op %]
90     <div class="yui-g">
91     <form method="post" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
92         <fieldset class="rows">
93             <legend>Use a barcode file</legend>
94      <ol>
95             <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" /></li>
96             <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepickerfrom" />
97             </li>
98           </ol>
99         </fieldset>
100
101         <!-- submit button for uploaded file -->
102         <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
103
104         <fieldset class="rows">
105         <legend>Select items you want to check</legend>
106         <ol><li>
107         <label for="branch">Library: </label>
108             <input type="radio" name="branch" value="homebranch"> Home library</input>
109             <input type="radio" name="branch" value="holdingbranch"> Current library</input>
110         </li><li>
111         <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
112             <option value="">All libraries</option>
113         [% FOREACH branchloo IN branchloop %]
114             [% IF ( branchloo.selected ) %]
115                 <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
116             [% ELSE %]
117                 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
118             [% END %]
119         [% END %]
120         </select>
121         </li>
122         [% IF (authorised_values) %]
123         <li>
124             <label for="locationloop">Shelving location (items.location) is: </label>
125         <select id="locationloop" name="location">
126                 <option value="">Filter location</option>
127         [% FOREACH value IN authorised_values %]
128             [% IF (value.selected) %]
129                 <option value="[% value.authorised_value %]" selected="selected">[% value.lib %]</option>
130             [% ELSE %]
131                 <option value="[% value.authorised_value %]">[% value.lib %]</option>
132             [% END %]
133         [% END %]
134         </select>        </li>
135         [% END %]
136         <li>
137             <label for="minlocation">Item callnumber between: </label>
138                 <input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber)  </li>
139            <li><label for="maxlocation">...and: </label>
140                 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation %]" />
141         </li>
142         [% IF (statuses) %]
143     </ol>
144     </fieldset>
145             <fieldset class="rows">
146             <legend>Item statuses</legend>
147             <div name="statuses" style="display: block;">
148                   [% FOREACH status IN statuses %]
149                       [% IF (status.values) %]
150                           <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
151                               <legend>[% status.fieldname %]</legend>
152                               <ul id="statuses-[% fieldname %]" style="display: inline;">
153                               [% FOREACH value IN status.values %]
154                                   [% IF (value.lib) %]<li>
155                                     <label for="[% value.id %]">
156                                       [% value.lib %]
157                                     </label>
158                                     <input type="checkbox" name="status-[% status.fieldname %]-[% value.authorised_value %]" id="[% value.authorised_value %]" />
159                                   </li>[% END %]
160                               [% END %]
161                               </ul>
162                           </fieldset>
163                       [% END %]
164                   [% END %]
165                 </div>
166             </fieldset>
167         <fieldset class="rows">
168           <ol>
169         [% END %]
170
171         <li><label for="datelastseen">Inventory date:</label>
172             <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepickerfrom" />
173         </li>
174         <li><label for="ignoreissued">Skip items on loan: </label>
175             [% IF (ignoreissued) %]
176             <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" /></li>
177             [% ELSE %]
178             <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li>
179             [% END %]
180         <li>
181            <label for="CSVexport">Export to CSV file: </label>
182            <input type="checkbox" name="CSVexport" id="CSVexport" />
183         </li>
184         <li>
185             <label for="compareinv2barcd">Compare barcodes list to results: </label>
186             <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
187         </li>
188         </ol>
189   </fieldset>
190             <input type="hidden" name="op" value="do_it" />
191
192             <!-- repeat submit button for generating shelf list -->
193             <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
194     </form>
195     </div>
196     </div>
197     [% END %]
198     [% IF (op) %]
199     <form method="post" action="/cgi-bin/koha/tools/inventory.pl" class="checkboxed">
200     <input type="hidden" name="markseen" value="1" />
201     <input type="hidden" name="minlocation" value="[% minlocation %]" />
202     <input type="hidden" name="maxlocation" value="[% maxlocation %]" />
203     <input type="hidden" name="location" value="[% location %]" />
204     <input type="hidden" name="branchcode" value="[% branchcode %]" />
205     <input type="hidden" name="datelastseen" value="[% datelastseen %]" />
206
207     [% UNLESS compareinv2barcd %]
208       <div><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
209     [% END %]
210
211     <table id="inventoryt">
212     <thead>
213         <tr>
214             [% UNLESS compareinv2barcd %]<th>Seen</th>[% END %]
215             <th>Barcode</th>
216             <th>Library</th>
217             <th>Title</th>
218             <th>Status</th>
219             <th>Lost</th>
220             <th>Damaged</th>
221             <th>Unseen since</th>
222             <th>Problems</th>
223         </tr>
224     </thead>
225     <tbody>
226     [% FOREACH result IN loop %]
227         <tr>
228             [% UNLESS compareinv2barcd %]
229               <td>
230                 <input type="checkbox" name="SEEN-[% result.itemnumber %]" value="1" />
231               </td>
232             [% END %]
233             <td>
234             [% result.barcode | html %]
235             </td>
236             <td>
237             [% result.homebranch | html %] [% result.location | html %] [[% result.itemcallnumber | html %]]
238             </td>
239             <td>
240             <p><a href="#" onclick="window.open('/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% result.biblionumber %]','marcview','width=800,height=600,toolbar=0,scrollbars=1');">[% result.title | html %]</a></p><p>[% result.author | html %]</p>
241             </td>
242             <td>
243             [% result.notforloan | html %]
244             </td>
245             <td>
246             [% result.itemlost | html %]
247             </td>
248             <td>
249             [% result.damaged | html %]
250             </td>
251             <td>
252             [% result.datelastseen | $KohaDates | html %]
253             </td>
254             <td>
255             [% IF result.problem == 'wrongplace' %]
256                 <p>Item should not have been scanned</p>
257             [% ELSIF result.problem == 'missingitem' %]
258                 <p>Item missing</p>
259             [% ELSIF result.problem == 'changestatus' %]
260                 <p>Change item status</p>
261             [% ELSIF result.problem == 'not_scanned' %]
262                 <p>Item should have been scanned</p>
263             [% END %]
264             </td>
265         </tr>
266     [% END %]
267     </tbody>
268     </table>
269     <div class="spacer"></div>
270     [% UNLESS compareinv2barcd %]
271       <div style="padding : .3em 0"><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
272       <input type="submit" id="markseenandquit" value="Mark seen and quit" />
273       <input type="submit" value="Mark Seen and Continue &gt;&gt;" id="markseenandcontinuebutton" />
274       <input type="submit" value="Continue without Marking &gt;&gt;" id="continuewithoutmarkingbutton" class="submit" />
275     [% END %]
276     </form>
277
278     </div>
279
280     [% END %]
281 </div>
282 <div class="yui-b">
283 [% INCLUDE 'tools-menu.inc' %]
284 </div>
285 </div>
286 [% INCLUDE 'intranet-bottom.inc' %]