Bugzilla – Attachment 168013 Details for
Bug 37172
HoldItem and HoldTitle do not check all the values of "hold_fulfillment_policy" rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37172 - HoldItem and HoldTitle do not check all the values of "hold_fulfillment_policy" rule
Bug-37172---HoldItem-and-HoldTitle-do-not-check-al.patch (text/plain), 3.24 KB, created by
Arthur Suzuki
on 2024-06-24 13:56:12 UTC
(
hide
)
Description:
Bug 37172 - HoldItem and HoldTitle do not check all the values of "hold_fulfillment_policy" rule
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2024-06-24 13:56:12 UTC
Size:
3.24 KB
patch
obsolete
>From 2f6a1b4080ef104c518cf5173b474ce272b91192 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Thu, 13 Jun 2024 09:13:29 +0200 >Subject: [PATCH] Bug 37172 - HoldItem and HoldTitle do not check all the > values of "hold_fulfillment_policy" rule > >--- > C4/ILSDI/Services.pm | 24 +++++------------------- > C4/Reserves.pm | 6 ++++++ > 2 files changed, 11 insertions(+), 19 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index a214836d93b..58f0028734b 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -758,20 +758,12 @@ sub HoldTitle { > > my $title = $biblio ? $biblio->title : ''; > >+ my $branch = $cgi->param('pickup_location') // $patron->branchcode; >+ > # Check if the biblio can be reserved >- my $code = CanBookBeReserved( $borrowernumber, $biblionumber )->{status}; >+ my $code = CanBookBeReserved( $borrowernumber, $biblionumber, $branch )->{status}; > return { code => $code } unless ( $code eq 'OK' ); > >- my $branch; >- >- # Pickup branch management >- if ( $cgi->param('pickup_location') ) { >- $branch = $cgi->param('pickup_location'); >- return { code => 'LocationNotFound' } unless Koha::Libraries->find($branch); >- } else { # if the request provide no branch, use the borrower's branch >- $branch = $patron->branchcode; >- } >- > my $destination = Koha::Libraries->find($branch); > return { code => 'libraryNotPickupLocation' } unless $destination->pickup_location; > return { code => 'cannotBeTransferred' } unless $biblio->can_be_transferred({ to => $destination }); >@@ -858,14 +850,8 @@ sub HoldItem { > # If the biblio does not match the item, return an error code > return { code => 'RecordNotFound' } if $item->biblionumber ne $biblio->biblionumber; > >- # Pickup branch management >- my $branch; >- if ( $cgi->param('pickup_location') ) { >- $branch = $cgi->param('pickup_location'); >- return { code => 'LocationNotFound' } unless Koha::Libraries->find($branch); >- } else { # if the request provide no branch, use the borrower's branch >- $branch = $patron->branchcode; >- } >+ # Pickup branch management} >+ my $branch = $cgi->param('pickup_location') // $patron->branchcode; > > # Check for item disponibility > my $canitembereserved = C4::Reserves::CanItemBeReserved( $patron, $item, $branch )->{status}; >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 5056c5b51bd..ba641fbb2cc 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -633,6 +633,12 @@ sub CanItemBeReserved { > unless ($item->can_be_transferred({ to => $destination })) { > return { status => 'cannotBeTransferred' }; > } >+ if ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch' && $pickup_branchcode ne $item->homebranch) { >+ return { status => 'cannotBeTransferred' }; >+ } >+ if ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch' && $pickup_branchcode ne $item->holdingbranch) { >+ return { status => 'cannotBeTransferred' }; >+ } > if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup' && !$item_library->validate_hold_sibling( {branchcode => $pickup_branchcode} )) { > return { status => 'pickupNotInHoldGroup' }; > } >-- >2.45.1
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 37172
: 168013