Bug 23007: Retain focus on 'barcode' input if transfers don't block circ

To test:
 1 - Apply patches
 2 - Update database
 3 - Confirm TransfersBlockCirc defaults to 'Block'
 4 - Check in an item that needs transfer
 5 - Confirm you must deal with the modal to proceed
 6 - Repeat checking to get 'wrong-transfer-modal'
 7 - Confirm you must deal with it to proceed
 8 - Switch the pref to 'Don't block'
 9 - Find a new item or cancel/fulfill the preceeding transfer
10 - Check in the item to generate transfer
11 - Note focus remains on the barcode field and you can continue scanning (or typing if you don't have a scanner)
12 - Note typing and pressing enter continues without requiring you to deal with modal
13 - Repeat for wrong transfer modal
14 - Verify hold and other modals still block continuing circulation

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-06-12 19:54:42 +00:00 committed by Martin Renvoize
parent 541b1fca0b
commit b5f1297aa9
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -293,7 +293,7 @@
[% END # /BLOCK all_checkin_messages %]
[% IF wrongbranch %]
<div id="wrong-branch-modal" class="modal fade audio-alert-action">
<div id="wrong-branch-modal" class="modal fade audio-alert-action block">
<div class="modal-dialog">
<div class="modal-content">
<form method="post" action="returns.pl" name="mainform" id="mainform">
@ -331,9 +331,13 @@
[% END # /IF wrongbranch %]
<!-- case of a mistake in transfer loop -->
[% UNLESS ( hold_auto_filled && diffbranch ) %]
[% IF WrongTransfer && !transfertodo %]
<div id="wrong-transfer-modal" class="modal fade audio-alert-action">
[% IF Koha.Preference('TransfersBlockCirc') %]
<div id="wrong-transfer-modal" class="modal fade audio-alert-action block">
[% ELSE %]
<div id="wrong-transfer-modal" class="modal fade audio-alert-action noblock">
[% END %]
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -372,10 +376,11 @@
</div> <!-- /.modal-dialog -->
</div> <!-- /#wrong-transfer-modal -->
[% END # /IF WrongTransfer && !transfertodo %]
[% END # /UNLESS hold_auto_filled && diffbranch %]
[% IF ( found ) %]
[% IF ( waiting ) %]
<div id="hold-found1" class="modal fade audio-alert-action">
<div id="hold-found1" class="modal fade audio-alert-action block">
<div class="modal-dialog">
<div class="modal-content">
<form method="post" action="returns.pl" class="confirm">
@ -468,7 +473,11 @@
[% END # /IF waiting %]
[% IF transfer || needstransfer %]
<div id="item-transfer-modal" class="modal fade audio-alert-action">
[% IF Koha.Preference('TransfersBlockCirc') %]
<div id="item-transfer-modal" class="modal fade audio-alert-action block">
[% ELSE %]
<div id="item-transfer-modal" class="modal fade audio-alert-action noblock">
[% END %]1
<div class="modal-dialog">
<div class="modal-content">
<form method="post" action="returns.pl" name="mainform" id="mainform">
@ -522,7 +531,7 @@
<!-- case of simple return no issue or transfer but with a reservation -->
[% IF ( reserved ) %]
<!-- reserved -->
<div id="hold-found2" class="modal fade audio-alert-action">
<div id="hold-found2" class="modal fade audio-alert-action block">
<div class="modal-dialog">
<div class="modal-content">
<form method="post" action="returns.pl" class="confirm">
@ -885,12 +894,17 @@
$("#barcode").focus();
}
$(document).ready(function () {
$(".modal").modal({ backdrop: 'static' }).on('shown.bs.modal', function() {
$(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
$("#barcode").prop("disabled", true);
$(".show_checkin_dialog").show();
}).on('hidden.bs.modal', function() {
$("#barcode").prop("disabled", false).focus();
});
$(".modal.noblock").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
$("#barcode").prop("disabled", false).focus();
}).on('hidden.bs.modal', function() {
$("#barcode").prop("disabled", false).focus();
});
$("body").on("click", ".show_checkin_dialog button", function(e){
e.preventDefault();