Bugzilla – Attachment 37955 Details for
Bug 10423
Date not well formatted on 'print summary' from patron account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[ALTERNATIVE PATCH] Bug 10423: Prevent race condition on printing a ReserveSlip
Bug-10423-Prevent-race-condition-on-printing-a-Res.patch (text/plain), 8.60 KB, created by
Jonathan Druart
on 2015-04-16 12:19:56 UTC
(
hide
)
Description:
[ALTERNATIVE PATCH] Bug 10423: Prevent race condition on printing a ReserveSlip
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-16 12:19:56 UTC
Size:
8.60 KB
patch
obsolete
>From ac0c66e02e9fefc89ea38f7c89bd0dab2cacf27c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 16 Apr 2015 14:10:30 +0200 >Subject: [PATCH] Bug 10423: 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 () { > <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" /> > <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" /> > <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" /> >- <input type="submit" class="approve" value="Confirm" /> >- <input type="submit" value="Print slip and confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&borrowernumber=[% borrowernumber %]&biblionumber=[% itembiblionumber %]&op=slip'); this.form.submit();" /> >+ <input type="submit" class="approve" value="Confirm" /> >+ <input type="hidden" name="print_slip" value="0" /> >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >+ <input type="submit" value="Print slip and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" /> > <input type="hidden" name="return_date_override" value="[% return_date_override %]" /> > <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" /> > </form> >@@ -199,7 +207,8 @@ $(document).ready(function () { > <form method="post" action="returns.pl" class="confirm"> > <input type="submit" class="approve" value="Confirm" /> > >- <input type="submit" value="Print and confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&biblionumber=[% itembiblionumber %]&op=slip'); this.form.submit();" /> >+ <input type="hidden" name="print_slip" value="0" /> >+ <input type="submit" value="Print and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" /> > [% FOREACH inputloo IN inputloop %] > <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" /> > <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" /> >@@ -207,6 +216,7 @@ $(document).ready(function () { > [% END %] > <input type="hidden" name="itemnumber" value="[% itemnumber %]" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" /> > <input type="hidden" name="resbarcode" value="[% barcode %]" /> > <input type="hidden" name="diffBranch" value="[% destbranch %]" /> > <input type="hidden" name="exemptfine" value="[% exemptfine %]" /> >@@ -244,7 +254,10 @@ $(document).ready(function () { > > <form method="post" action="returns.pl" class="confirm"> > <input type="submit" class="approve" value="Confirm" /> >- <input type="submit" value="Print slip and confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&borrowernumber=[% borrowernumber %]&biblionumber=[% itembiblionumber %]&op=slip'); this.form.submit();" /> >+ <input type="hidden" name="print_slip" value="0" /> >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" /> >+ <input type="submit" value="Print slip and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" /> > [% FOREACH inputloo IN inputloop %] > <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" /> > <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" /> >@@ -359,12 +372,13 @@ $(document).ready(function () { > <h4><strong>Hold at</strong> [% destbranchname %]</h4> > [% END %] > <form method="post" action="returns.pl" class="confirm"> >+ <input type="hidden" name="print_slip" value="0" /> > [% IF ( transfertodo ) %] > <input type="submit" class="approve" value="Confirm hold and transfer" /> >- <input type="submit" value="Print slip, transfer, and confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&borrowernumber=[% borrowernumber %]&biblionumber=[% itembiblionumber %]&op=slip'); this.form.submit();" /> >+ <input type="submit" value="Print slip, transfer, and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit()" /> > [% ELSE %] > <input type="submit" class="approve" value="Confirm hold" /> >- <input type="submit" value="Print slip and confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&biblionumber=[% itembiblionumber %]&op=slip'); this.form.submit();" /> >+ <input type="submit" value="Print slip and confirm" class="print" onclick="this.form.submit();" /> > [% END %] > <input type="submit" class="deny" value="Ignore" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;" /> > [% FOREACH inputloo IN inputloop %] >@@ -373,6 +387,7 @@ $(document).ready(function () { > <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %] > <input type="hidden" name="itemnumber" value="[% itemnumber %]" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" /> > <input type="hidden" name="resbarcode" value="[% barcode %]" /> > <input type="hidden" name="diffBranch" value="[% destbranch %]" /> > <input type="hidden" name="exemptfine" value="[% exemptfine %]" /> >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10423
:
18690
|
37907
|
37947
|
37955
|
38005
|
38109