3 [% USE AuthorisedValues %]
6 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
11 [% t("Results") | html %] ›
13 [% t("Inventory") | html %] ›
14 [% t("Cataloging") | html %] ›
15 [% t("Koha") | html %]
17 [% INCLUDE 'doc-head-close.inc' %]
20 <body id="tools_inventory" class="tools">
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/cataloguing/cataloging-home.pl">Cataloging</a>
32 [% WRAPPER breadcrumb_item %]
33 <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
35 [% WRAPPER breadcrumb_item bc_active= 1 %]
39 [% WRAPPER breadcrumb_item bc_active= 1 %]
40 <span>Inventory</span>
43 [% END #/ WRAPPER breadcrumbs %]
44 [% END #/ WRAPPER sub-header.inc %]
46 <div class="main container-fluid">
48 <div class="col-sm-10 col-sm-push-2">
52 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates with_hours => 1 %]</div>
53 <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
54 [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
55 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
56 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length | html %] barcodes that were too long.</div>[% END %]
57 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
58 [% IF (err_data && err_data>1) %]<div class="dialog alert">There were [% err_data | html %] barcodes that contained at least one unprintable character.</div>[% END %]
59 [% FOREACH error IN errorloop %]
60 <div class="dialog alert">
61 [% error.barcode | html %]
62 [% IF (error.ERR_BARCODE) %]: <span>Barcode not found.</span>[% END %]
63 [% IF (error.ERR_WTHDRAWN) %]: <span>Item withdrawn.</span>[% END %]
64 [% IF (error.ERR_ONLOAN_RET) %]: <span>Item was on loan. It was checked in before being marked as seen.</span>[% END %]
65 [% IF (error.ERR_ONLOAN_NOT_RET) %]: <span>Item was on loan and could not be checked in.</span>[% END %]
70 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
71 <fieldset class="rows">
72 <legend>Use a barcode file</legend>
74 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" />
75 <input type="button" id="resetuploadbarcodes" name="resetuploadbarcodes" value="Reset" /></li>
78 <fieldset class="rows">
79 <legend>Or scan items one by one</legend>
82 <label for="barcodelist">Barcode list (one barcode per line): </label>
83 <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
87 <fieldset class="rows">
88 <legend>Parameters</legend>
90 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | html %]" class="flatpickr" /></li>
91 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
92 <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>
93 <li><label for="out_of_order">Check barcodes list for items shelved out of order: </label><input type="checkbox" name="out_of_order" id="out_of_order" disabled /></li>
96 <fieldset class="rows">
97 <legend>Item location filters</legend>
99 <label for="branch">Location: </label>
100 <input type="radio" name="branch" value="homebranch"> Home library</input>
101 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
103 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
104 <option value="">All libraries</option>
105 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
108 [% IF (authorised_values) %]
110 <label for="locationloop">Shelving location (items.location) is: </label>
111 <select id="locationloop" name="location">
112 <option value="">Filter location</option>
113 [% FOREACH value IN authorised_values %]
114 [% IF (value.selected) %]
115 <option value="[% value.authorised_value | html %]" selected="selected">[% value.lib | html %]</option>
117 <option value="[% value.authorised_value | html %]">[% value.lib | html %]</option>
122 [% SET ccodes = AuthorisedValues.GetAuthValueDropbox('CCODE') %]
123 [% IF ( ccodes.count > 0 ) %]
125 <label for="ccode">Collection code: </label>
126 <select id="ccodeloop" name="ccode">
127 <option value="">Filter collection</option>
128 [% FOREACH cc IN ccodes %]
129 [% IF (ccode == cc.authorised_value) %]
130 <option value="[% cc.authorised_value | html %]" selected="selected">[% cc.lib | html %]</option>
132 <option value="[% cc.authorised_value | html %]">[% cc.lib | html %]</option>
139 <label for="minlocation">Item call number between: </label>
140 <input type="text" name="minlocation" id="minlocation" value="[% minlocation | html %]" /> (items.itemcallnumber) </li>
141 <li><label for="maxlocation">...and: </label>
142 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation | html %]" />
144 <label for="class_source">Call number classification scheme</label>
145 <select name="class_source">
146 [% FOREACH class_source IN class_sources %]
147 [% IF class_source.cn_source == pref_class %]
148 <option value="[% class_source.cn_source | html %]" selected="selected">[% class_source.description | html %] (default)</option>
150 <option value="[% class_source.cn_source | html %]">[% class_source.description | html %]</option>
158 <fieldset class="rows" id="optionalfilters">
159 <legend>Optional filters for inventory list or comparing barcodes</legend>
160 <span class="hint">Scanned items are expected to match one of the selected "not for loan" criteria if any are checked.</span>
162 <div id="statuses" style="display: block;">
163 [% FOREACH status IN statuses %]
164 [% IF (status.values) %]
165 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
166 <legend>[% status.fieldname | html %]</legend>
167 <ul id="statuses-[% fieldname | html %]" style="display: inline;">
168 [% FOREACH value IN status.values %]
170 <li style="list-style: none;">
171 <label for="[% value.id | html %]">
172 [% IF ( status.fieldname == 'items.notforloan' && value.authorised_value == 0 && value.lib == '__IGNORE__' ) %]
175 [% value.lib | html %]
178 <input type="checkbox" name="status-[% status.fieldname | html %]-[% value.authorised_value | html %]" id="[% value.authorised_value | html %]" />
190 <label for="datelastseen">Last inventory date:</label>
191 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | html %]" class="flatpickr" />
192 (Skip records marked as seen on or after this date.)
195 <label for="ignoreissued">Skip items on loan: </label>
196 [% IF (ignoreissued) %]
197 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
199 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
203 <label for="ignore_waiting_holds">Skip items on hold awaiting pickup: </label>
204 <input type="checkbox" id="ignore_waiting_holds" name="ignore_waiting_holds" />
207 <label>Item types: </label>
208 <div class="branchselector">
209 <p><a href="#" id="checkallitemtypes"> <i class="fa fa-check"></i> Select all</a> | <a href="#" id="checknoneitemtypes"> <i class="fa fa-times"></i> Clear all</a></p>
210 <div class="branchgridrow">
211 [% FOREACH itemtype IN itemtypes %]
212 <div class="branchgriditem">
213 <input id="itemtype-[% itemtype.itemtype | html %]" class="branch_select" type="checkbox" name="itemtype-[% itemtype.itemtype | html %]" value="[% itemtype.itemtype | html %]" />
214 <label for="itemtype-[% itemtype.itemtype | html %]">[% itemtype.description | html %]</label>
216 [% IF loop.count() % 4 == 0 && !loop.last() %]
218 <div class="branchgridrow">
229 <fieldset class="rows">
230 <legend>Additional options</legend>
234 <label for="CSVexport">Export to CSV file: </label>
235 <input type="checkbox" name="CSVexport" id="CSVexport" />
238 <input type="hidden" name="op" value="do_it" />
241 <fieldset class="action"><input type="submit" class="btn btn-primary" value="Submit" /></fieldset>
246 <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
247 <input type="hidden" name="minlocation" value="[% minlocation | html %]" />
248 <input type="hidden" name="maxlocation" value="[% maxlocation | html %]" />
249 <input type="hidden" name="location" value="[% location | html %]" />
250 <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
251 <input type="hidden" name="datelastseen" value="[% datelastseen | html %]" />
252 <input type="hidden" name="ccode" value="[% ccode | html %]" />
254 [% UNLESS uploadedbarcodesflag %]
255 <div><a href="#" class="checkall"><i class="fa fa-check"></i> Select all</a> <a href="#" class="clearall"><i class="fa fa-times"></i> Clear all</a></div>
258 <div class="page-section">
259 <table id="inventoryt">
262 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
266 <th>Collection code</th>
267 <th class="anti-the">Title</th>
268 <th>Not for loan</th>
277 [% FOREACH result IN loop %]
279 [% UNLESS uploadedbarcodesflag %]
281 <input type="checkbox" name="SEEN-[% result.itemnumber | html %]" value="1" />
285 [% result.barcode | html %]
287 <td data-order="[% result.cn_sort | html %]">
288 [% result.itemcallnumber | html %]
291 [% Branches.GetName( result.homebranch ) | html %]
292 <span class="shelvingloc">[% result.location | html %]</span>
295 <span class="ccode">[% result.ccode | html %]</span>
298 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber | uri %]" class="openWin">[% result.title | html %]</a>
299 [% IF ( result.author ) %]
300 by <span class="author">[% result.author | html %]</span>
304 [% result.notforloan | html %]
307 [% result.itemlost | html %]
310 [% result.damaged | html %]
313 [% result.withdrawn | html %]
315 <td data-order="[% result.datelastseen | html %]">
316 [% result.datelastseen | $KohaDates with_hours => 1 %]
319 [% FOREACH problem IN result.problems %]
320 [% IF problem.key == 'wrongplace' %]
321 <span>Found in wrong place</span><br/>
322 [% ELSIF problem.key == 'changestatus' %]
323 [% IF result.notforloan %]
324 <span>Item has unselected "Not for loan" status "[% result.notforloan | html %]"</span><br/>
326 <span>Items has no "not for loan" status</span><br/>
328 [% ELSIF problem.key == 'not_scanned' %]
329 <span>Missing (not scanned)</span><br/>
330 [% ELSIF problem.key == 'checkedout' %]
331 <span>Still checked out</span><br/>
332 [% ELSIF problem.key == 'no_barcode' %]
333 <span>No barcode</span><br/>
334 [% ELSIF problem.key == 'out_of_order' %]
335 <span>Item may be shelved out of order</span><br/>
345 <div class="spacer"></div>
346 [% UNLESS uploadedbarcodesflag %]
347 <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-times"></i> Clear all</a></div>
348 <input type="submit" id="markseenandquit" class="btn btn-primary" value="Mark seen and quit" />
349 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
350 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
358 </div> <!-- /.col-sm-10.col-sm-push-2 -->
360 <div class="col-sm-2 col-sm-pull-10">
362 [% INCLUDE 'cat-menu.inc' %]
364 </div> <!-- .col-sm-2.col-sm-pull-10 -->
365 </div> <!-- /.row -->
367 [% MACRO jsinclude BLOCK %]
368 [% INCLUDE 'datatables.inc' %]
369 [% INCLUDE 'calendar.inc' %]
371 function checkForm() {
372 if ( $('#uploadbarcodes').val() && $('#barcodelist').val() ) {
373 alert(_("You have uploaded a barcode file and scanned barcodes at the same time. Please choose one of the two options."));
376 if ( $('#uploadbarcodes').val() || $('#barcodelist').val() ) {
378 $('#branchloop').val() ||
379 $('#locationloop').val() ||
380 $('#minlocation').val() ||
381 $('#maxlocation').val() ||
382 $('#statuses input:checked').length
385 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
386 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
387 _("Are you sure you want to do this?")
395 function barcodesProvided() {
396 if( $("#uploadbarcodes").val() || $("#barcodelist").val() ) {
397 $("#setdate").prop('disabled',false);
398 $("#compareinv2barcd").prop('disabled',false);
399 $("#compareinv2barcd").attr('checked',true); // default
400 $("#dont_checkin").prop('disabled',false);
401 $("#out_of_order").prop('disabled',false);
402 if( $("#compareinv2barcd").attr('checked') ) {
403 $("fieldset#optionalfilters").show();
404 $("#ignoreissued").attr('checked',true); // default
406 $("fieldset#optionalfilters").hide();
407 $("#ignoreissued").attr('checked',false);
410 $("#setdate").prop('disabled',true);
411 $("#compareinv2barcd").prop('disabled',true);
412 $("#compareinv2barcd").attr('checked',false);
413 $("#dont_checkin").prop('disabled',true);
414 $("#dont_checkin").attr('checked',false);
415 $("#out_of_order").prop('disabled',true);
416 $("#out_of_order").attr('checked',false);
417 $("fieldset#optionalfilters").show();
421 $(document).ready(function(){
422 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
423 'sPaginationType': 'full_numbers',
424 [% IF compareinv2barcd %]
425 // sort on callnumber
426 "aaSorting": [[ 1, "asc" ]],
428 // first column contains checkboxes
430 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
431 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] }
433 // 3rd column is callnumber
434 "aaSorting": [[ 2, "asc" ]],
436 'fnDrawCallback': function() {
437 //bind the click handler script to the newly created elements held in the table
438 $('.openWin').bind('click',function(e){
440 openWindow(this.href,'marcview',800,600);
446 $("#continuewithoutmarkingbutton").click(function(){
447 inventorydt.fnPageChange( 'next' );
451 $("#markseenandcontinuebutton").click(function(){
453 $("input:checked").each(function() {
454 param += "|" + $(this).attr('name');
456 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
457 inventorydt.fnPageChange( 'next' );
461 $("#markseenandquit").click(function(){
463 $("input:checked").each(function() {
464 param += "|" + $(this).attr('name');
468 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
469 data: { seen: param},
472 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
476 $(".checkall").click(function(e){
478 $("#inventoryt input:checkbox").each(function(){
479 $(this).prop("checked", true);
482 $(".clearall").click(function(e){
484 $("#inventoryt input:checkbox").each(function(){
485 $(this).prop("checked", false);
488 $("#inventory_form").on("submit",function(){
492 $("#resetuploadbarcodes").click(function() {
493 $("#uploadbarcodes").val("");
497 // #uploadbarcodes and #compareinv2barcd determine the behavior of
498 // the controls within the barcode fieldset and the optional filters
499 $("#uploadbarcodes").change(barcodesProvided);
500 $("#barcodelist").on("change keyup paste", barcodesProvided);
502 $("#compareinv2barcd").click(function() {
503 if( $("#compareinv2barcd").attr('checked') ) {
504 $("fieldset#optionalfilters").show();
505 $("#ignoreissued").attr('checked',true); // default
507 $("#ignoreissued").attr('checked',false);
508 $("fieldset#optionalfilters").hide();
512 $("#checkallitemtypes").on("click",function(e){
514 $(".branch_select").prop("checked",1);
516 $("#checknoneitemtypes").on("click",function(e){
518 $(".branch_select").prop("checked",0);
524 [% INCLUDE 'intranet-bottom.inc' %]