Bug 28064: Add dotransfer field to slip print submission

By changing the code to only do a javascript triggered submission from
the from button we lose the original buttons name and value elements
upon submission.

This patch checks for those fields in the JS capture and triggers the
addition of a new hidden form field to contain the dotransfer data.

Test plan
1/ Set AutomaticItemReturn system preference is set to "Don't"
2/ Check in an item that belongs to another library, a dialog will ask
   you if you want to transfer.
3/ Click 'Yes, print slip'
4/ Look at the item record and note the status is 'Available'.
5/ Apply patch
6/ Follow steps 2 - 4
7/ Note the status is now 'In transit to...'
8/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ccd7242532)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9f57b8dcc5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2021-03-31 13:06:49 +01:00 committed by Andrew Fuerste-Henry
parent 2150aa4747
commit 553eeeffb0
1 changed files with 4 additions and 0 deletions

View File

@ -1039,6 +1039,10 @@
this.form.print_slip.value = 1;
let barcode = document.getElementById('confirm-hold-barcode');
if ( barcode ) barcode.remove();
if ($(this).attr('name') == "dotransfer") {
var dotransfer = $("<input>").attr("type", "hidden").attr("name", "dotransfer").val("Yes");
$('#mainform').append(dotransfer);
}
this.form.submit();
});