Bugzilla – Attachment 189590 Details for
Bug 19814
Batch Check-in function
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19814: Merge code for cud-affect_reserve and HoldsAutoFill
Bug-19814-Merge-code-for-cud-affectreserve-and-Hol.patch (text/plain), 3.78 KB, created by
Marcel de Rooy
on 2025-11-14 11:12:57 UTC
(
hide
)
Description:
Bug 19814: Merge code for cud-affect_reserve and HoldsAutoFill
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-11-14 11:12:57 UTC
Size:
3.78 KB
patch
obsolete
>From 13e749b1c564f49a450134d3e474757e06d5d52b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 13 Nov 2025 12:19:45 +0100 >Subject: [PATCH] Bug 19814: Merge code for cud-affect_reserve and > HoldsAutoFill >Content-Type: text/plain; charset=utf-8 > >This merges two nearly identical wrappers around a call of >ModReserveAffect into a new subroutine. >We could reuse this subroutine in the batch checkin loop. > >Test plan: >Verify that everything still works as expected by: >- Disable HoldsAutoFill if needed. >- Pick item with a hold (for current library). >- Check item in via staff main page, checkin tab. >- Confirm hold. >- Repeat but confirm hold for another pickup library. >- Enable HoldsAutoFill. >- Repeat both previous checkins. There is no popup now. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > circ/returns.pl | 42 +++++++++++++++++++++--------------------- > 1 file changed, 21 insertions(+), 21 deletions(-) > >diff --git a/circ/returns.pl b/circ/returns.pl >index b1e182b271..5caa379c19 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -114,6 +114,24 @@ for my $counter ( $query->multi_param("checkin_counter") ) { > > my $op = $query->param('op') // ''; > >+# Routine for handling the confirm hold part of cud-affect_reserve. >+# Reused during batch checkin. >+sub confirm_hold { >+ my ( $item, $hold, $diffBranchSend, $desk_id ) = @_; >+ >+ # diffBranchSend tells ModReserveAffect whether document is expected in this library or not, >+ # i.e., whether to apply waiting status >+ ModReserveAffect( $item->itemnumber, $hold->borrowernumber, $diffBranchSend, $hold->reserve_id, $desk_id ); >+ >+ if ($diffBranchSend) { >+ my $tobranch = $hold->pickup_library(); >+ >+ # Add transfer, enqueue if one is already in the queue, and immediately set to in transit >+ my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } ); >+ $transfer->transit; >+ } >+} >+ > ############ > # Deal with the requests.... > my $itemnumber = $query->param('itemnumber'); >@@ -146,18 +164,7 @@ if ( $query->param('reserve_id') && $op eq 'cud-affect_reserve' ) { > } > } else { > my $diffBranchSend = ( $userenv_branch ne $diffBranchReturned ) ? $diffBranchReturned : undef; >- >- # diffBranchSend tells ModReserveAffect whether document is expected in this library or not, >- # i.e., whether to apply waiting status >- ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id ); >- >- if ($diffBranchSend) { >- my $tobranch = $hold->pickup_library(); >- >- # Add transfer, enqueue if one is already in the queue, and immediately set to in transit >- my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } ); >- $transfer->transit; >- } >+ confirm_hold( $item, $hold, $diffBranchSend, $desk_id ); > } > } > >@@ -703,15 +710,8 @@ if ( $messages->{'ResFound'} ) { > my $biblio = $item->biblio; > > my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef; >- ModReserveAffect( $itemnumber, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); >- >- if ($diffBranchSend) { >- my $tobranch = Koha::Libraries->find( $reserve->{branchcode} ); >- >- # Add transfer, enqueue if one is already in the queue, and immediately set to in transit >- my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } ); >- $transfer->transit; >- } >+ my $hold = Koha::Holds->find( $reserve->{reserve_id} ); #TODO Hold not found >+ confirm_hold( $item, $hold, $diffBranchSend, $desk_id ) if $hold; > > $template->param( > hold_auto_filled => 1, >-- >2.39.5
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 19814
:
186374
|
186375
|
189487
|
189488
|
189489
|
189490
|
189529
|
189568
|
189586
|
189587
|
189588
|
189589
| 189590 |
189591
|
189592