Bugzilla – Attachment 139628 Details for
Bug 30847
Cleanup opac-reserve.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30847: Cleanup calculation of holds and rank
Bug-30847-Cleanup-calculation-of-holds-and-rank.patch (text/plain), 2.17 KB, created by
Victor Grousset/tuxayo
on 2022-08-23 00:17:43 UTC
(
hide
)
Description:
Bug 30847: Cleanup calculation of holds and rank
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2022-08-23 00:17:43 UTC
Size:
2.17 KB
patch
obsolete
>From 8f2cb3424e4f54531171e05a97f6f403a089a959 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 25 May 2022 13:23:26 +0000 >Subject: [PATCH] Bug 30847: Cleanup calculation of holds and rank > >Currently we loop over all the holds on the record to get a count of the reserves not >waiting and a rank for the upcoming hold > >We can simply count the number of nont waiting holds and add 1 > >Note: Before this patch the count of holds included the new hold we were going to place >which meant rank and count were the same. I believe countaing existing holds and our >upcoming rank is the correct behavior > >To test: > 1 - Set OPACShowHoldQueueDetails system preference to 'Show holds and their priorty level' > 2 - Place a few holds on a bib on the staff side > 3 - Mark 1 waiting > 4 - Attempt to place hold on the bib on the opac > 5 - Note 'Your priority' and 'Number of holds' are the same number > 6 - Place another hold, confirm both increase > 7 - Set another hold waiting, confirm both decrease > 8 - Apply patch > 9 - Confirm 'Your priority' is now 1 greater than Number of holds >10 - Place a hold, set a hold waiting, confirm numbers adjust as appropriate > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > opac/opac-reserve.pl | 15 +++------------ > 1 file changed, 3 insertions(+), 12 deletions(-) > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 724a2ba354..5575614e84 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -167,18 +167,9 @@ foreach my $biblioNumber (@biblionumbers) { > > # Compute the priority rank. > $biblioData->{object} = $biblio; >- my $holds = $biblio->holds; >- my $rank = $holds->count; >- $biblioData->{reservecount} = 1; # new reserve >- while ( my $hold = $holds->next ) { >- if ( $hold->is_waiting ) { >- $rank--; >- } >- else { >- $biblioData->{reservecount}++; >- } >- } >- $biblioData->{rank} = $rank + 1; >+ my $reservecount = $biblio->holds->search({ found => [ {"!=" => "W"},undef] })->count; >+ $biblioData->{reservecount} = $reservecount; >+ $biblioData->{rank} = $reservecount + 1; > } > > # >-- >2.37.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 30847
:
135340
|
135341
|
135342
|
135343
|
135344
|
135345
|
135346
|
135347
|
135348
|
137668
|
137669
|
137670
|
137671
|
137672
|
137673
|
137674
|
137675
|
138654
|
138655
|
138934
|
138935
|
138936
|
138937
|
138938
|
138939
|
138940
|
138941
|
139628
|
139629
|
139630
|
139631
|
139632
|
139633
|
139634
|
139635
|
139915
|
139916
|
139917
|
139918
|
139919
|
139920
|
139921
|
139922
|
139923