Bugzilla – Attachment 144509 Details for
Bug 30860
Performance: Add option for CanBookBeReserved to return all item values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30860: Get all items info for CanBookBeReserved on opac-reserve.pl
Bug-30860-Get-all-items-info-for-CanBookBeReserved.patch (text/plain), 1.87 KB, created by
ByWater Sandboxes
on 2022-12-08 20:08:02 UTC
(
hide
)
Description:
Bug 30860: Get all items info for CanBookBeReserved on opac-reserve.pl
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2022-12-08 20:08:02 UTC
Size:
1.87 KB
patch
obsolete
>From 64b3aee568cbe5ce3b8fb00f6ddd28cf728bf900 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 27 May 2022 13:07:04 +0000 >Subject: [PATCH] Bug 30860: Get all items info for CanBookBeReserved on > opac-reserve.pl > >Repeat test above on OPAC > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >--- > opac/opac-reserve.pl | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 85f2659a87..f927f26e93 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -428,6 +428,7 @@ foreach my $biblioNum (@biblionumbers) { > # (before this loop was inside that sub loop so it was O(n^2) ) > my $items_any_available; > $items_any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblioNum, patron => $patron }) if $patron; >+ my $can_book_be_reserved = CanBookBeReserved( $borrowernumber, $biblioNum, undef, { return_all_items => 1 }); > foreach my $item (@{$biblioData->{items}}) { > > my $item_info = $item->unblessed; >@@ -468,8 +469,8 @@ foreach my $biblioNum (@biblionumbers) { > > # items_any_available defined outside of the current loop, > # so we avoiding loop inside IsAvailableForItemLevelRequest: >- my $policy_holdallowed = >- CanItemBeReserved( $patron, $item )->{status} eq 'OK' && >+ my $policy_holdallowed &&= >+ $can_book_be_reserved->{$item->itemnumber}->{status} eq 'OK' && > IsAvailableForItemLevelRequest($item, $patron, undef, $items_any_available); > > if ($policy_holdallowed) { >@@ -530,7 +531,7 @@ foreach my $biblioNum (@biblionumbers) { > } > } > >- my $status = CanBookBeReserved( $borrowernumber, $biblioNum )->{status}; >+ my $status = $can_book_be_reserved->{status}; > $biblioLoopIter{holdable} &&= $status eq 'OK'; > $biblioLoopIter{$status} = 1; > >-- >2.30.2
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 30860
:
135426
|
135427
|
135428
|
135429
|
144480
|
144481
|
144482
|
144483
|
144506
|
144507
|
144508
|
144509
|
145577
|
145578
|
145579
|
145580
|
145581
|
145582
|
145583
|
145584
|
147695
|
148562
|
148812
|
149124
|
149377