Bug 8557 - Unexpected behavior with scanners
This is an alternative to the original implementation - this one works in chrome as well as firefox. To test: 1) Set syspref 'AcqCreateItem' to 'Create Item when receiving an order.' 2) Create a basket for a vendor, add an order line. 3) Search for this vendor using Vendor search 4) Receive Shipment for this vendor and choose the title you ordered in 2) 5) You will get the dialog to create related item(s) 6) Fill in Item 0 through o (see screenshot) 7) Scan Barcode for field p - Barcode 7) Result: Scanner sends a [return], form closes and you had no chance to fill in fields t - z Signed-off-by: Marc Veron <veron@veron.ch> Tested with Chrome Version 23.0.1271.97 m and Firefox 17.0.1, both behave as expected. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested with Firefox and Chromium in Ubuntu. Additional test done: 1) Add a new subscription, choose 'receive adds items' 2) Receive an issue, fill out $p with a barcode 3) Make sure hitting enter in the barcode field does not send the form. All tests pass and QA script pass. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
This commit is contained in:
parent
a9409025c0
commit
b7f0b6ed77
|
|
@ -4,6 +4,25 @@
|
|||
[% INCLUDE 'additem.js.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/js/additem.js"> </script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var nav = window.Event ? true : false;
|
||||
if (nav) {
|
||||
window.captureEvents(Event.KEYDOWN);
|
||||
window.onkeydown = NetscapeEventHandler_KeyDown;
|
||||
} else {
|
||||
document.onkeydown = IEEventHandler_KeyDown;
|
||||
}
|
||||
|
||||
function NetscapeEventHandler_KeyDown(e) {
|
||||
if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
function IEEventHandler_KeyDown() {
|
||||
if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
//<![CDATA[
|
||||
function Check(form) {
|
||||
[% IF (AcqCreateItemReceiving) %]
|
||||
|
|
@ -316,7 +335,6 @@
|
|||
|
||||
</div>
|
||||
</div><div class="yui-g"><fieldset class="action">
|
||||
<input type="submit" onclick="return false;" style="display: none;" id="phony_submit" value="phony_submit" name="phony_submit" />
|
||||
<input type="submit" value="Save" class="button" accesskey="w" />
|
||||
<a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Cancel</a>
|
||||
</fieldset></div> </form>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,24 @@
|
|||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
var nav = window.Event ? true : false;
|
||||
if (nav) {
|
||||
window.captureEvents(Event.KEYDOWN);
|
||||
window.onkeydown = NetscapeEventHandler_KeyDown;
|
||||
} else {
|
||||
document.onkeydown = IEEventHandler_KeyDown;
|
||||
}
|
||||
|
||||
function NetscapeEventHandler_KeyDown(e) {
|
||||
if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
function IEEventHandler_KeyDown() {
|
||||
if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
//<![CDATA[
|
||||
function generateReceive() {
|
||||
var subscriptionid = document.getElementsByName("subscriptionid")[0].value;
|
||||
|
|
@ -371,7 +389,6 @@ $(document).ready(function() {
|
|||
|
||||
</table>
|
||||
<fieldset class="action">
|
||||
<input type="submit" onclick="return false;" style="display: none;" id="phony_submit" value="phony_submit" name="phony_submit" />
|
||||
<input type="submit" value="Save" class="button" accesskey="w" />
|
||||
[% UNLESS ( serialsadditems ) %] <input type="button" onclick="javascript:generateReceive()" value="Multi receiving">[% END %]
|
||||
</fieldset>
|
||||
|
|
|
|||
Loading…
Reference in New Issue