Bugzilla – Attachment 107780 Details for
Bug 25408
CanBookBeReserved & CanItemBeReserved should check "opacitemholds" policy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25408: (QA follow-up)
Bug-25408-QA-follow-up.patch (text/plain), 2.66 KB, created by
Arthur Suzuki
on 2020-08-04 14:47:36 UTC
(
hide
)
Description:
Bug 25408: (QA follow-up)
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2020-08-04 14:47:36 UTC
Size:
2.66 KB
patch
obsolete
>From 820535244922c9a090f9a297900ec65062f59ffd Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Fri, 3 Jul 2020 16:55:24 +0200 >Subject: [PATCH] Bug 25408: (QA follow-up) > >--- > C4/Reserves.pm | 22 +++++++--------------- > 1 file changed, 7 insertions(+), 15 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 30de970146..296a85c725 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -326,11 +326,11 @@ sub CanBookBeReserved{ > } > > my $canReserve = { status => '' }; >- my ($rights,$item); >- > foreach my $itemnumber (@itemnumbers) { > $canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); >- return { status => 'RecordHoldNotAllowed' } if $canReserve->{rights}->{opacitemholds} eq 'F'; >+ my $opacitemholds = $canReserve->{rights}->{opacitemholds}; >+ return { status => 'RecordHoldNotAllowed' } if $opacitemholds eq 'F'; >+ return { status => 'OK' } if ( $canReserve->{status} eq 'notReservable' && $opacitemholds eq 'N' ); > return { status => 'OK' } if $canReserve->{status} eq 'OK'; > } > return $canReserve; >@@ -414,7 +414,8 @@ sub CanItemBeReserved { > } > > # we retrieve rights >- if ( my $rights = GetHoldRule( $borrower->{'categorycode'}, $item->effective_itemtype, $branchcode ) ) { >+ my $rights; >+ if ( $rights = GetHoldRule( $borrower->{'categorycode'}, $item->effective_itemtype, $branchcode ) ) { > $ruleitemtype = $rights->{itemtype}; > $allowedreserves = $rights->{reservesallowed} // $allowedreserves; > $holds_per_record = $rights->{holds_per_record} // $holds_per_record; >@@ -434,18 +435,9 @@ sub CanItemBeReserved { > my $holds = Koha::Holds->search($search_params); > > if ( $opacitemholds eq "N" ) { >- return { status => "notReservable" }; >+ return { status => "notReservable", rights => $rights }; > } > >- $item = Koha::Items->find( $itemnumber ); >- >- my $holds = Koha::Holds->search( >- { >- borrowernumber => $borrowernumber, >- biblionumber => $item->biblionumber, >- } >- ); >- > if ( defined $holds_per_record && $holds_per_record ne '' > && $holds->count() >= $holds_per_record ) { > return { status => "tooManyHoldsForThisRecord", limit => $holds_per_record }; >@@ -2279,7 +2271,7 @@ sub GetHoldRule { > ); > $rules->{holds_per_record} = $holds_per_x_rules->{holds_per_record}; > $rules->{holds_per_day} = $holds_per_x_rules->{holds_per_day}; >- $rules->{opacitemholds} = $holds_per_x_rules->{opacitemholds}; >+ $rules->{opacitemholds} = $holds_per_x_rules->{opacitemholds} // 'Y'; > > return $rules; > } >-- >2.11.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 25408
:
104488
|
104496
|
105988
|
105989
|
105990
|
106413
|
106414
|
106521
|
106535
|
106536
|
106537
|
107777
|
107778
|
107779
|
107780
|
111681
|
111682
|
111693
|
111696
|
111716
|
111717
|
111718
|
111719
|
111720
|
111721
|
115125
|
115126
|
115127
|
115128
|
115129
|
115130
|
121524
|
121525
|
121526
|
121527
|
121528
|
121530
|
128505
|
130180
|
130181
|
132658
|
132660
|
132661
|
164680
|
164681
|
164682
|
164684
|
164685
|
164686
|
164693
|
164694
|
164878
|
164879
|
165111
|
165112
|
165442
|
165443
|
165444
|
165445