Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
Mark Tompsett 536345c3b8 Bug 11253: tools/inventory.pl: fix handling of inventory date
This patch fixes a stray call to output_pref() that had not been
updated by the patch for 10380, which caused a crash when uploading
a barcode file when the dd/mm/yyyy dateformat is in use.

TEST PLAN
---------
Set I18N/L10N system preference of dateformat to dd/mm/yyyy.
Go to inventory/stocktaking tool.
Browse for the barcode file.
Select the branch (i.e. not All libraries) to match.
Click submit
KABOOM!

Apply patch
Go to inventory/stocktaking tool.
Browse for the barcode file.
Select the branch (i.e. not All libraries) to match.
Click submit
Table displays dates in "Unseen since" column.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Before the patch, I had this error when using dateformat=ddmmyy:
Template process failed: undef error - The 'day' parameter ("2014") to DateTime::new did not pass the 'an integer which is a possible valid day of month' callback at /usr/local/share/perl5/Params/Validate/PP.pm line 633.
This patch corrects the problem.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Confirmed problem before applying the patch. Tested with the
patch all dateformat setting still work correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-20 15:03:36 +00:00

286 lines
12 KiB
Text

[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Inventory</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'calendar.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
'sPaginationType': 'full_numbers',
[% IF compareinv2barcd %]
"aoColumnDefs": [ { "bSortable": false, "aTargets": [ 1 ] } ]
[% ELSE %]
"aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0 ] } ]
[% END %]
} ));
$("#continuewithoutmarkingbutton").click(function(){
inventorydt.fnPageChange( 'next' );
return false;
});
$("#markseenandcontinuebutton").click(function(){
var param = '';
$("input:checked").each(function() {
param += "|" + $(this).attr('name');
});
$.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
inventorydt.fnPageChange( 'next' );
return false;
});
$("#markseenandquit").click(function(){
var param = '';
$("input:checked").each(function() {
param += "|" + $(this).attr('name');
});
$.ajax({
type: 'POST',
url: '/cgi-bin/koha/tools/ajax-inventory.pl',
data: { seen: param},
async: false
});
document.location.href = '/cgi-bin/koha/tools/inventory.pl';
return false;
});
$(".checkall").click(function(){
$(".checkboxed").checkCheckboxes();
return false;
});
$(".clearall").click(function(){
$(".checkboxed").unCheckCheckboxes();
return false;
});
});
//]]>
</script>
</head>
<body id="tools_inventory" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<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>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Inventory/Stocktaking</h1>
[% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
[% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
[% FOREACH error IN errorloop %]
<div class="dialog alert">
[% error.barcode %]
[% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
[% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
[% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
[% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
</div>
[% END %]
[% UNLESS op %]
<div class="yui-g">
<form method="post" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
<fieldset class="rows">
<legend>Use a barcode file</legend>
<ol>
<li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" /></li>
<li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepickerfrom" />
</li>
</ol>
</fieldset>
<!-- submit button for uploaded file -->
<fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
<fieldset class="rows">
<legend>Select items you want to check</legend>
<ol><li>
<label for="branch">Library: </label>
<input type="radio" name="branch" value="homebranch"> Home library</input>
<input type="radio" name="branch" value="holdingbranch"> Current library</input>
</li><li>
<label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
<option value="">All libraries</option>
[% FOREACH branchloo IN branchloop %]
[% IF ( branchloo.selected ) %]
<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
[% ELSE %]
<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
[% END %]
[% END %]
</select>
</li>
[% IF (authorised_values) %]
<li>
<label for="locationloop">Shelving location (items.location) is: </label>
<select id="locationloop" name="location">
<option value="">Filter location</option>
[% FOREACH value IN authorised_values %]
[% IF (value.selected) %]
<option value="[% value.authorised_value %]" selected="selected">[% value.lib %]</option>
[% ELSE %]
<option value="[% value.authorised_value %]">[% value.lib %]</option>
[% END %]
[% END %]
</select> </li>
[% END %]
<li>
<label for="minlocation">Item callnumber between: </label>
<input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber) </li>
<li><label for="maxlocation">...and: </label>
<input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation %]" />
</li>
[% IF (statuses) %]
</ol>
</fieldset>
<fieldset class="rows">
<legend>Item statuses</legend>
<div name="statuses" style="display: block;">
[% FOREACH status IN statuses %]
[% IF (status.values) %]
<fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
<legend>[% status.fieldname %]</legend>
<ul id="statuses-[% fieldname %]" style="display: inline;">
[% FOREACH value IN status.values %]
[% IF (value.lib) %]<li>
<label for="[% value.id %]">
[% value.lib %]
</label>
<input type="checkbox" name="status-[% status.fieldname %]-[% value.authorised_value %]" id="[% value.authorised_value %]" />
</li>[% END %]
[% END %]
</ul>
</fieldset>
[% END %]
[% END %]
</div>
</fieldset>
<fieldset class="rows">
<ol>
[% END %]
<li><label for="datelastseen">Inventory date:</label>
<input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepickerfrom" />
</li>
<li><label for="ignoreissued">Skip items on loan: </label>
[% IF (ignoreissued) %]
<input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" /></li>
[% ELSE %]
<input type="checkbox" id="ignoreissued" name="ignoreissued" /></li>
[% END %]
<li>
<label for="CSVexport">Export to CSV file: </label>
<input type="checkbox" name="CSVexport" id="CSVexport" />
</li>
<li>
<label for="compareinv2barcd">Compare barcodes list to results: </label>
<input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
</li>
</ol>
</fieldset>
<input type="hidden" name="op" value="do_it" />
<!-- repeat submit button for generating shelf list -->
<fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
</form>
</div>
</div>
[% END %]
[% IF (op) %]
<form method="post" action="/cgi-bin/koha/tools/inventory.pl" class="checkboxed">
<input type="hidden" name="markseen" value="1" />
<input type="hidden" name="minlocation" value="[% minlocation %]" />
<input type="hidden" name="maxlocation" value="[% maxlocation %]" />
<input type="hidden" name="location" value="[% location %]" />
<input type="hidden" name="branchcode" value="[% branchcode %]" />
<input type="hidden" name="datelastseen" value="[% datelastseen %]" />
[% UNLESS compareinv2barcd %]
<div><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
[% END %]
<table id="inventoryt">
<thead>
<tr>
[% UNLESS compareinv2barcd %]<th>Seen</th>[% END %]
<th>Barcode</th>
<th>Library</th>
<th>Title</th>
<th>Status</th>
<th>Lost</th>
<th>Damaged</th>
<th>Unseen since</th>
<th>Problems</th>
</tr>
</thead>
<tbody>
[% FOREACH result IN loop %]
<tr>
[% UNLESS compareinv2barcd %]
<td>
<input type="checkbox" name="SEEN-[% result.itemnumber %]" value="1" />
</td>
[% END %]
<td>
[% result.barcode | html %]
</td>
<td>
[% result.homebranch | html %] [% result.location | html %] [[% result.itemcallnumber | html %]]
</td>
<td>
<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>
</td>
<td>
[% result.notforloan | html %]
</td>
<td>
[% result.itemlost | html %]
</td>
<td>
[% result.damaged | html %]
</td>
<td>
[% result.datelastseen | $KohaDates | html %]
</td>
<td>
[% IF result.problem == 'wrongplace' %]
<p>Item should not have been scanned</p>
[% ELSIF result.problem == 'missingitem' %]
<p>Item missing</p>
[% ELSIF result.problem == 'changestatus' %]
<p>Change item status</p>
[% ELSIF result.problem == 'not_scanned' %]
<p>Item should have been scanned</p>
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
<div class="spacer"></div>
[% UNLESS compareinv2barcd %]
<div style="padding : .3em 0"><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
<input type="submit" id="markseenandquit" value="Mark seen and quit" />
<input type="submit" value="Mark Seen and Continue &gt;&gt;" id="markseenandcontinuebutton" />
<input type="submit" value="Continue without Marking &gt;&gt;" id="continuewithoutmarkingbutton" class="submit" />
[% END %]
</form>
</div>
[% END %]
</div>
<div class="yui-b">
[% INCLUDE 'tools-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]