Bugzilla – Attachment 135429 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.93 KB, created by
Nick Clemens (kidclamp)
on 2022-05-27 13:20:07 UTC
(
hide
)
Description:
Bug 30860: Get all items info for CanBookBeReserved on opac-reserve.pl
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-05-27 13:20:07 UTC
Size:
1.93 KB
patch
obsolete
>From 281a76fcf579013ed13976b6dcd71f69c16862c6 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 >--- > opac/opac-reserve.pl | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index b8ffca4e44..ff8130a25b 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -476,6 +476,8 @@ 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 }); >+ warn Data::Dumper::Dumper($can_book_be_reserved); > foreach my $itemInfo (@{$biblioData->{itemInfos}}) { > my $itemNum = $itemInfo->{itemnumber}; > my $item = $visible_items->{$itemNum}; >@@ -566,7 +568,7 @@ foreach my $biblioNum (@biblionumbers) { > # items_any_available defined outside of the current loop, > # so we avoiding loop inside IsAvailableForItemLevelRequest: > $policy_holdallowed &&= >- CanItemBeReserved( $patron, $item )->{status} eq 'OK' && >+ $can_book_be_reserved->{$item->itemnumber}->{status} eq 'OK' && > IsAvailableForItemLevelRequest($item, $patron, undef, $items_any_available); > > if ($policy_holdallowed) { >@@ -629,7 +631,7 @@ foreach my $biblioNum (@biblionumbers) { > } > } > >- my $status = CanBookBeReserved( $borrowernumber, $biblioNum )->{status}; >+ my $status = $can_book_be_reserved->{status}; > $biblioLoopIter{holdable} &&= $status eq 'OK'; > $biblioLoopIter{already_patron_possession} = $status eq 'alreadypossession'; > >-- >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