From 98288164abfb7c4f7ae8d716bfbc7d4863479d47 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Apr 2015 14:10:30 +0200 Subject: [PATCH] Bug 13482: Prevent race condition on printing a ReserveSlip The problem has been well described by Kyle and Nicole on bug 7255 description and comment 1. With this counter patch, I suggest to popup AFTER the return has been confirmed. This will remove the race condition and avoid to pass itemnumber to the pl file as in the patch submitted by Olli. Only the borrowernumber and biblionumber are needed (transfer and op are never used by circ/hold-transfer-slip.pl). Test plan: It is very hard to know all cases (at least 6) where the popup is displayed. Try at least to get the hold and the transfer confirmation messages. You should get the popup if you click on "print slip" button. --- circ/hold-transfer-slip.pl | 1 - circ/returns.pl | 9 ++++++++ .../intranet-tmpl/prog/en/modules/circ/returns.tt | 27 +++++++++++++++++----- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/circ/hold-transfer-slip.pl b/circ/hold-transfer-slip.pl index db0869c..e2805c1 100755 --- a/circ/hold-transfer-slip.pl +++ b/circ/hold-transfer-slip.pl @@ -38,7 +38,6 @@ my $session = get_session($sessionID); my $biblionumber = $input->param('biblionumber'); my $borrowernumber = $input->param('borrowernumber'); -my $transfer = $input->param('transfer'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { diff --git a/circ/returns.pl b/circ/returns.pl index a7e9c6e..a5e589e 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -68,6 +68,15 @@ if ($session->param('branch') eq 'NO_LIBRARY_SET'){ exit; } +# Print a reserve slip on this page +if ( $query->param('print_slip') ) { + $template->param( + print_slip => 1, + borrowernumber => $query->param('borrowernumber'), + biblionumber => $query->param('biblionumber'), + ); +} + ##################### #Global vars my $branches = GetBranches(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 3fe2e53..bf4f990 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -18,6 +18,11 @@ function Dopop(link) { $("#barcode").focus(); } $(document).ready(function () { + + [% IF print_slip %] + Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&biblionumber=[% biblionumber %]'); + [% END %] + $("#return_date_override").datetimepicker({ onClose: function(dateText, inst) { $("#barcode").focus(); }, defaultDate: -1, @@ -160,8 +165,11 @@ $(document).ready(function () { - - + + + + + @@ -199,7 +207,8 @@ $(document).ready(function () {
- + + [% FOREACH inputloo IN inputloop %] @@ -207,6 +216,7 @@ $(document).ready(function () { [% END %] + @@ -244,7 +254,10 @@ $(document).ready(function () { - + + + + [% FOREACH inputloo IN inputloop %] @@ -359,12 +372,13 @@ $(document).ready(function () {

Hold at [% destbranchname %]

[% END %] + [% IF ( transfertodo ) %] - + [% ELSE %] - + [% END %] [% FOREACH inputloo IN inputloop %] @@ -373,6 +387,7 @@ $(document).ready(function () { [% END %] + -- 2.1.0