From 63ae8a24d2682f71a33da9f425f1fed6d4e91068 Mon Sep 17 00:00:00 2001 From: Matthias Le Gac Date: Tue, 2 Apr 2024 16:26:17 -0400 Subject: [PATCH] Bug 9762: Change how to pass the param --- C4/Circulation.pm | 51 ++++++++++++++++++--------------------------- circ/circulation.pl | 1 + 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index a974a45ac1..ec4f8743fb 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -318,21 +318,6 @@ A recall for this item was found, and the item needs to be transferred to the re =cut -my $query = CGI->new; - -my $stickyduedate = $query->param('stickyduedate'); -my $duedatespec = $query->param('duedatespec'); -my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec; -if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) { - undef $restoreduedatespec; -} -my $issueconfirmed = $query->param('issueconfirmed'); -my $cancelreserve = $query->param('cancelreserve'); -my $cancel_recall = $query->param('cancel_recall'); -my $recall_id = $query->param('recall_id'); -my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice -my $charges = $query->param('charges') || q{}; - sub transferbook { my $params = shift; my $tbr = $params->{to_branch}; @@ -795,6 +780,7 @@ sub CanBookBeIssued { my $onsite_checkout = $params->{onsite_checkout} || 0; my $override_high_holds = $params->{override_high_holds} || 0; + my $issueconfirmed = $params->{issueconfirmed} || 0; my $item_object = $params->{item} // Koha::Items->find( { barcode => $barcode } ); @@ -818,7 +804,7 @@ sub CanBookBeIssued { my $now = dt_from_string(); my $message; - my @message; + my @message_log; $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron ); @@ -830,7 +816,7 @@ sub CanBookBeIssued { } else { $message = "sticky due date is invalid or due date in the past"; } - push( @message, "sticky due date is invalid or due date in the past" ); + push( @message_log, "sticky due date is invalid or due date in the past" ); } } @@ -883,7 +869,7 @@ sub CanBookBeIssued { } else { $message = "borrower is restricted"; } - push( @message, "borrower is restricted" ); + push( @message_log, "borrower is restricted" ); } } @@ -957,7 +943,7 @@ sub CanBookBeIssued { } else { $message = "borrower had amend"; } - push( @message, "borrower had amend" ); + push( @message_log, "borrower had amend" ); } } elsif ( $non_issues_charges > $amountlimit && !$allowfineoverride) { $issuingimpossible{DEBT} = $non_issues_charges; @@ -969,7 +955,7 @@ sub CanBookBeIssued { } else { $message = "borrower had amend"; } - push( @message, "borrower had amend" ); + push( @message_log, "borrower had amend" ); } } } @@ -1059,7 +1045,7 @@ sub CanBookBeIssued { } else { $message = "item is checked out for someone else"; } - push( @message, "item is checked out for someone else" ); + push( @message_log, "item is checked out for someone else" ); } } } @@ -1090,7 +1076,7 @@ sub CanBookBeIssued { } else { $message = "too many checkout"; } - push( @message, "too many checkout" ); + push( @message_log, "too many checkout" ); } } else { $issuingimpossible{TOO_MANY} = $toomany->{reason}; @@ -1125,7 +1111,7 @@ sub CanBookBeIssued { } else { $message = "item not for loan"; } - push( @message, "item not for loan" ); + push( @message_log, "item not for loan" ); } } } @@ -1179,7 +1165,7 @@ sub CanBookBeIssued { } else { $message = "item lost"; } - push( @message, "item lost" ); + push( @message_log, "item lost" ); } } if ( C4::Context->preference("IndependentBranches") ) { @@ -1284,7 +1270,10 @@ sub CanBookBeIssued { } else { $message = "item is on reserve and waiting, but has been reserved by some other patron."; } - push( @message, "item is on reserve and waiting, but has been reserved by some other patron" ); + push( + @message_log, + "item is on reserve and waiting, but has been reserved by some other patron" + ); } } elsif ( $restype eq "Reserved" ) { @@ -1303,7 +1292,7 @@ sub CanBookBeIssued { } else { $message = "item is on reserve for someone else"; } - push( @message, "item is on reserve for someone else" ); + push( @message_log, "item is on reserve for someone else" ); } } elsif ( $restype eq "Transferred" ) { @@ -1322,7 +1311,7 @@ sub CanBookBeIssued { } else { $message = "item is determined hold being transferred for someone else"; } - push( @message, "item is determined hold being transferred for someone else" ); + push( @message_log, "item is determined hold being transferred for someone else" ); } } elsif ( $restype eq "Processing" ) { @@ -1341,7 +1330,7 @@ sub CanBookBeIssued { } else { $message = "item is determined hold being processed for someone else"; } - push( @message, "item is determined hold being processed for someone else" ); + push( @message_log, "item is determined hold being processed for someone else" ); } } } @@ -1391,7 +1380,7 @@ sub CanBookBeIssued { } else { $message = "age restriction"; } - push( @message, "age restriction" ); + push( @message_log, "age restriction" ); } else { $issuingimpossible{AGE_RESTRICTION} = "$agerestriction"; @@ -1459,7 +1448,7 @@ sub CanBookBeIssued { my $infos = ( { - message => \@message, + message => \@message_log, borrowernumber => $borrower->borrowernumber, barcode => $barcode, manager_id => $user, @@ -1478,7 +1467,7 @@ sub CanBookBeIssued { } - return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, ); + return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, \@message_log ); } =head2 CanBookBeReturned diff --git a/circ/circulation.pl b/circ/circulation.pl index 4f0c5b8f80..0905238bba 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -337,6 +337,7 @@ if (@$barcodes && $op eq 'cud-checkout') { { onsite_checkout => $onsite_checkout, override_high_holds => $override_high_holds || $override_high_holds_tmp || 0, + issueconfirmed => $issueconfirmed, } ); } catch { -- 2.34.1