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