Bugzilla – Attachment 94389 Details for
Bug 22806
CanBookBeReserve and CanItemBeReserve do not check AllowHoldsOnPatronsPossessions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22806 : CanBookBeReserved and CanItemBeReserved must check AllowHoldsOnPatronsPossessions
Bug-22806--CanBookBeReserved-and-CanItemBeReserved.patch (text/plain), 2.11 KB, created by
Arthur Suzuki
on 2019-10-18 07:56:35 UTC
(
hide
)
Description:
Bug 22806 : CanBookBeReserved and CanItemBeReserved must check AllowHoldsOnPatronsPossessions
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2019-10-18 07:56:35 UTC
Size:
2.11 KB
patch
obsolete
>From a7784e75d3b9e07236901c1a6a09af5744e6cd80 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Tue, 14 May 2019 02:30:26 +0200 >Subject: [PATCH] Bug 22806 : CanBookBeReserved and CanItemBeReserved must > check AllowHoldsOnPatronsPossessions > >Test plan : >1 - set AllowHoldsOnPatronsPossessions to "Don't Allow" >2 - Checkout an item to a borrower >3 - Try to reserve an item using ILS-DI WebService -> Will work without complaining. >4 - Cancel the hold and apply patch >5 - Repeat 3 -> Should not place hold and show error "NotHoldable" > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> >--- > C4/Reserves.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 8a45beb..22bc691 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -276,6 +276,12 @@ See CanItemBeReserved() for possible return values. > sub CanBookBeReserved{ > my ($borrowernumber, $biblionumber, $pickup_branchcode) = @_; > >+ # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) >+ if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') >+ && C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $biblio->biblionumber ) ) { >+ return { status =>'itemAlreadyOnLoan' }; >+ } >+ > my @itemnumbers = Koha::Items->search({ biblionumber => $biblionumber})->get_column("itemnumber"); > #get items linked via host records > my @hostitems = get_hostitemnumbers_of($biblionumber); >@@ -338,6 +344,12 @@ sub CanItemBeReserved { > return { status =>'itemAlreadyOnHold' } > if Koha::Holds->search( { borrowernumber => $borrowernumber, itemnumber => $itemnumber } )->count(); > >+ # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) >+ if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') >+ && C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $biblio->biblionumber ) ) { >+ return { status =>'itemAlreadyOnLoan' }; >+ } >+ > my $controlbranch = C4::Context->preference('ReservesControlBranch'); > > my $querycount = q{ >-- >2.7.4
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 22806
:
89039
|
89724
|
91784
|
94388
|
94389
|
97947
|
99881
|
99882
|
99883
|
99884
|
99885
|
100091
|
100092
|
100093
|
100173
|
100174
|
100175
|
106564
|
106778
|
106779
|
106780
|
107760
|
107806
|
110100
|
110101
|
110102
|
110973
|
110974
|
110975
|
110976
|
111771
|
111772
|
111773
|
111774
|
112824