5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Tools › Inventory</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/datatables.css") %]
11 <body id="tools_inventory" class="tools">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
15 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF (loop) %]<a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a> › Results[% ELSE %]Inventory[% END %]</div>
17 <div id="doc3" class="yui-t2">
23 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>
24 <div class="dialog alert">Number of potential barcodes read: [% LinesRead %]</div>[% END %]
25 [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
26 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
27 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length %] barcodes that were too long.</div>[% END %]
28 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
29 [% IF (err_data && err_data>1) %]<div class="dialog alert">There were [% err_data %] barcodes that contained at least one unprintable character.</div>[% END %]
30 [% FOREACH error IN errorloop %]
31 <div class="dialog alert">
33 [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
34 [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
35 [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
36 [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
41 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
42 <fieldset class="rows">
43 <legend>Use a barcode file</legend>
45 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" /></li>
46 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" disabled /></li>
47 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
48 <li><label for="dont_checkin">Do not check in items scanned during inventory: </label><input type="checkbox" name="dont_checkin" id="dont_checkin" disabled /></li>
52 <fieldset class="rows">
53 <legend>Item location filters</legend>
55 <label for="branch">Library: </label>
56 <input type="radio" name="branch" value="homebranch"> Home library</input>
57 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
59 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
60 <option value="">All libraries</option>
61 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
64 [% IF (authorised_values) %]
66 <label for="locationloop">Shelving location (items.location) is: </label>
67 <select id="locationloop" name="location">
68 <option value="">Filter location</option>
69 [% FOREACH value IN authorised_values %]
70 [% IF (value.selected) %]
71 <option value="[% value.authorised_value %]" selected="selected">[% value.lib %]</option>
73 <option value="[% value.authorised_value %]">[% value.lib %]</option>
79 <label for="minlocation">Item callnumber between: </label>
80 <input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber) </li>
81 <li><label for="maxlocation">...and: </label>
82 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation %]" />
87 <fieldset class="rows" id="optionalfilters">
88 <legend>Optional filters for inventory list or comparing barcodes</legend>
90 <div id="statuses" style="display: block;">
91 [% FOREACH status IN statuses %]
92 [% IF (status.values) %]
93 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
94 <legend>[% status.fieldname %]</legend>
95 <ul id="statuses-[% fieldname %]" style="display: inline;">
96 [% FOREACH value IN status.values %]
99 <label for="[% value.id %]">
100 [% IF value.authorised_value==0 %]
106 <input type="checkbox" name="status-[% status.fieldname %]-[% value.authorised_value %]" id="[% value.authorised_value %]" />
118 <label for="datelastseen">Last inventory date:</label>
119 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepicker" />
120 (Skip records marked as seen on or after this date.)
123 <label for="ignoreissued">Skip items on loan: </label>
124 [% IF (ignoreissued) %]
125 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
127 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
133 <fieldset class="rows">
134 <legend>Additional options</legend>
138 <label for="CSVexport">Export to CSV file: </label>
139 <input type="checkbox" name="CSVexport" id="CSVexport" />
143 <input type="hidden" name="op" value="do_it" />
145 <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
151 <form method="post" action="/cgi-bin/koha/tools/inventory.pl" class="checkboxed">
152 <input type="hidden" name="minlocation" value="[% minlocation %]" />
153 <input type="hidden" name="maxlocation" value="[% maxlocation %]" />
154 <input type="hidden" name="location" value="[% location %]" />
155 <input type="hidden" name="branchcode" value="[% branchcode %]" />
156 <input type="hidden" name="datelastseen" value="[% datelastseen %]" />
158 [% UNLESS uploadedbarcodesflag %]
159 <div><a href="#" class="checkall"><i class="fa fa-check"></i> Select all</a> <a href="#" class="clearall"><i class="fa fa-remove"></i> Clear all</a></div>
162 <table id="inventoryt">
165 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
170 <th>Not for loan</th>
179 [% FOREACH result IN loop %]
181 [% UNLESS uploadedbarcodesflag %]
183 <input type="checkbox" name="SEEN-[% result.itemnumber %]" value="1" />
187 [% result.barcode | html %]
189 <td>[% result.itemcallnumber | html %]</td>
191 [% Branches.GetName( result.homebranch ) %]
192 <span class="shelvingloc">[% result.location | html %]</span>
195 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber %]" class="openWin">[% result.title | html %]</a>
196 [% IF ( result.author ) %]
197 by <span class="author">[% result.author | html %]</span>
201 [% result.notforloan | html %]
204 [% result.itemlost | html %]
207 [% result.damaged | html %]
210 [% result.withdrawn | html %]
213 [% result.datelastseen | $KohaDates | html %]
216 [% FOREACH problem IN result.problems %]
217 [% IF problem.key == 'wrongplace' %]
218 Found in wrong place<br/>
219 [% ELSIF problem.key == 'changestatus' %]
220 Unknown not-for-loan status<br/>
221 [% ELSIF problem.key == 'not_scanned' %]
222 Missing (not scanned)<br/>
223 [% ELSIF problem.key == 'checkedout' %]
224 Still checked out<br/>
225 [% ELSIF problem.key == 'no_barcode' %]
234 <div class="spacer"></div>
235 [% UNLESS uploadedbarcodesflag %]
236 <div style="padding : .3em 0"><a href="#" class="checkall"><i class="fa fa-check"></i> Select all</a> <a href="#" class="clearall"><i class="fa fa-remove"></i> Clear all</a></div>
237 <input type="submit" id="markseenandquit" value="Mark seen and quit" />
238 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
239 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
248 [% INCLUDE 'tools-menu.inc' %]
252 [% MACRO jsinclude BLOCK %]
253 [% Asset.js("js/tools-menu.js") %]
254 [% INCLUDE 'datatables.inc' %]
255 [% INCLUDE 'calendar.inc' %]
256 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
257 <script type="text/javascript">
258 function checkForm() {
259 if ( $('#uploadbarcodes').val() ) {
261 $('#branchloop').val() ||
262 $('#locationloop').val() ||
263 $('#minlocation').val() ||
264 $('#maxlocation').val() ||
265 $('#statuses input:checked').length
268 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
269 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
270 _("Are you sure you want to do this?")
278 $(document).ready(function(){
279 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
280 'sPaginationType': 'full_numbers',
281 [% IF compareinv2barcd %]
282 // sort on callnumber
283 "aaSorting": [[ 1, "asc" ]],
285 // first column contains checkboxes
287 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] },
289 // 3rd column is callnumber
290 "aaSorting": [[ 2, "asc" ]],
292 'fnDrawCallback': function() {
293 //bind the click handler script to the newly created elements held in the table
294 $('.openWin').bind('click',function(e){
296 openWindow(this.href,'marcview',800,600);
302 $("#continuewithoutmarkingbutton").click(function(){
303 inventorydt.fnPageChange( 'next' );
307 $("#markseenandcontinuebutton").click(function(){
309 $("input:checked").each(function() {
310 param += "|" + $(this).attr('name');
312 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
313 inventorydt.fnPageChange( 'next' );
317 $("#markseenandquit").click(function(){
319 $("input:checked").each(function() {
320 param += "|" + $(this).attr('name');
324 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
325 data: { seen: param},
328 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
333 $(".checkall").click(function(){
334 $(".checkboxed").checkCheckboxes();
337 $(".clearall").click(function(){
338 $(".checkboxed").unCheckCheckboxes();
341 $("#inventory_form").on("submit",function(){
345 // #uploadbarcodes and #compareinv2barcd determine the behavior of
346 // the controls within the barcode fieldset and the optional filters
347 $("#uploadbarcodes").change(function() {
348 if( $("#uploadbarcodes").val() ) {
349 $("#setdate").prop('disabled',false);
350 $("#compareinv2barcd").prop('disabled',false);
351 $("#compareinv2barcd").attr('checked',true); // default
352 $("#dont_checkin").prop('disabled',false);
353 if( $("#compareinv2barcd").attr('checked') ) {
354 $("fieldset#optionalfilters").show();
355 $("#ignoreissued").attr('checked',true); // default
357 $("fieldset#optionalfilters").hide();
358 $("#ignoreissued").attr('checked',false);
361 $("#setdate").prop('disabled',true);
362 $("#compareinv2barcd").prop('disabled',true);
363 $("#compareinv2barcd").attr('checked',false);
364 $("#dont_checkin").prop('disabled',true);
365 $("#dont_checkin").attr('checked',false);
366 $("fieldset#optionalfilters").show();
369 $("#compareinv2barcd").click(function() {
370 if( $("#compareinv2barcd").attr('checked') ) {
371 $("fieldset#optionalfilters").show();
372 $("#ignoreissued").attr('checked',true); // default
374 $("#ignoreissued").attr('checked',false);
375 $("fieldset#optionalfilters").hide();
382 [% INCLUDE 'intranet-bottom.inc' %]