Bugzilla – Attachment 20139 Details for
Bug 10663
Holds never block renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10663: Holds never block renewals
Bug-10663-Holds-never-block-renewals.patch (text/plain), 2.43 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-08-06 20:12:31 UTC
(
hide
)
Description:
Bug 10663: Holds never block renewals
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-08-06 20:12:31 UTC
Size:
2.43 KB
patch
obsolete
>From f9d325f9dae044cebbec0fedb05a6ed610ddaba5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 6 Aug 2013 17:08:28 -0300 >Subject: [PATCH] Bug 10663: Holds never block renewals > >Based on Katrin's patch, this one fixes GetReserveStatus to look for biblio-level >holds when an itemtype is passed and no item-level hold is set. > >Please test using Katrin's test plan. >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > C4/Reserves.pm | 37 ++++++++++++++++++++++++++++++++----- > 1 file changed, 32 insertions(+), 5 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 1f89127..81f1941 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -773,23 +773,50 @@ sub GetReserveStatus { > my $dbh = C4::Context->dbh; > > my ($sth, $found, $priority); >- if ( $itemnumber ) { >- $sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE itemnumber = ? order by priority LIMIT 1"); >+ >+ if ( defined $itemnumber ) { >+ # Search for item-level reserves >+ >+ $sth = $dbh->prepare(" >+ SELECT found, priority >+ FROM reserves >+ WHERE itemnumber = ? >+ ORDER BY priority >+ LIMIT 1" >+ ); > $sth->execute($itemnumber); > ($found, $priority) = $sth->fetchrow_array; >+ >+ if ( not defined $found and >+ not defined $priority ) { >+ # No item-level reserves, give biblio-level a try >+ $biblionumber = GetBiblionumberFromItemnumber( $itemnumber ); >+ } > } > >- if ( $biblionumber and not defined $found and not defined $priority ) { >- $sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE biblionumber = ? order by priority LIMIT 1"); >+ if ( defined $biblionumber ) { >+ # Search for biblio-level reserves >+ >+ $sth = $dbh->prepare(" >+ SELECT found, priority >+ FROM reserves >+ WHERE biblionumber = ? >+ ORDER BY priority >+ LIMIT 1" >+ ); > $sth->execute($biblionumber); > ($found, $priority) = $sth->fetchrow_array; > } > >- if(defined $found) { >+ if ( defined $found ) { > return 'Waiting' if $found eq 'W' and $priority == 0; > return 'Finished' if $found eq 'F'; >+ } >+ >+ if ( defined $priority ) { > return 'Reserved' if $priority > 0; > } >+ > return ''; > #empty string here will remove need for checking undef, or less log lines > } >-- >1.8.1.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 10663
:
19987
|
20129
|
20139
|
20140
|
20148
|
20149
|
20150
|
20151
|
20152
|
20153
|
20154
|
20155
|
20156
|
20362
|
20363
|
20364
|
22913