Bugzilla – Attachment 41813 Details for
Bug 9809
Get rid of reserveconstraints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9809 - Remove reserveconstraints references from C4::Reserves
Bug-9809---Remove-reserveconstraints-references-fr.patch (text/plain), 4.24 KB, created by
Marcel de Rooy
on 2015-08-24 06:58:09 UTC
(
hide
)
Description:
Bug 9809 - Remove reserveconstraints references from C4::Reserves
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-08-24 06:58:09 UTC
Size:
4.24 KB
patch
obsolete
>From c84b5ca30d5b3970c1c5f1f0e02ca51bf36edccb Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 30 Jun 2015 07:30:32 -0400 >Subject: [PATCH] Bug 9809 - Remove reserveconstraints references from > C4::Reserves >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Reserves.pm | 57 ++------------------------------------------------------ > 1 file changed, 2 insertions(+), 55 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 2beea87..4e27748 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -242,17 +242,7 @@ sub AddReserve { > > #} > ($const eq "o" || $const eq "e") or return $reserve_id; >- $query = qq{ >- INSERT INTO reserveconstraints >- (borrowernumber,biblionumber,reservedate,biblioitemnumber) >- VALUES >- (?,?,?,?) >- }; >- $sth = $dbh->prepare($query); # keep prepare outside the loop! >- foreach (@$bibitems) { >- $sth->execute($borrowernumber, $biblionumber, $resdate, $_); >- } >- >+ > return $reserve_id; > } > >@@ -334,44 +324,7 @@ sub GetReservesFromBiblionumber { > my $sth = $dbh->prepare($query); > $sth->execute( @params ); > my @results; >- my $i = 0; > while ( my $data = $sth->fetchrow_hashref ) { >- >- # FIXME - What is this doing? How do constraints work? >- if ($data->{constrainttype} eq 'o') { >- $query = ' >- SELECT biblioitemnumber >- FROM reserveconstraints >- WHERE biblionumber = ? >- AND borrowernumber = ? >- AND reservedate = ? >- '; >- my $csth = $dbh->prepare($query); >- $csth->execute($data->{biblionumber}, $data->{borrowernumber}, $data->{reservedate}); >- my @bibitemno; >- while ( my $bibitemnos = $csth->fetchrow_array ) { >- push( @bibitemno, $bibitemnos ); # FIXME: inefficient: use fetchall_arrayref >- } >- my $count = scalar @bibitemno; >- >- # if we have two or more different specific itemtypes >- # reserved by same person on same day >- my $bdata; >- if ( $count > 1 ) { >- $bdata = GetBiblioItemData( $bibitemno[$i] ); # FIXME: This doesn't make sense. >- $i++; # $i can increase each pass, but the next @bibitemno might be smaller? >- } >- else { >- # Look up the book we just found. >- $bdata = GetBiblioItemData( $bibitemno[0] ); >- } >- # Add the results of this latest search to the current >- # results. >- # FIXME - An 'each' would probably be more efficient. >- foreach my $key ( keys %$bdata ) { >- $data->{$key} = $bdata->{$key}; >- } >- } > push @results, $data; > } > return \@results; >@@ -2002,23 +1955,17 @@ sub _Findgroupreserve { > reserves.reservenotes AS reservenotes, > reserves.priority AS priority, > reserves.timestamp AS timestamp, >- reserveconstraints.biblioitemnumber AS biblioitemnumber, > reserves.itemnumber AS itemnumber, > reserves.reserve_id AS reserve_id > FROM reserves >- LEFT JOIN reserveconstraints ON reserves.biblionumber = reserveconstraints.biblionumber > WHERE reserves.biblionumber = ? >- AND ( ( reserveconstraints.biblioitemnumber = ? >- AND reserves.borrowernumber = reserveconstraints.borrowernumber >- AND reserves.reservedate = reserveconstraints.reservedate ) >- OR reserves.constrainttype='a' ) > AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?) > AND reserves.reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) > AND suspend = 0 > ORDER BY priority > }; > $sth = $dbh->prepare($query); >- $sth->execute( $biblio, $bibitem, $itemnumber, $lookahead||0); >+ $sth->execute( $biblio, $itemnumber, $lookahead||0); > @results = (); > while ( my $data = $sth->fetchrow_hashref ) { > push( @results, $data ) >-- >1.7.10.4
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 9809
:
37638
|
40733
|
40734
|
40735
|
40736
|
40737
|
40738
|
41754
|
41755
|
41756
|
41757
|
41758
|
41759
|
41760
|
41761
|
41767
|
41768
|
41769
|
41770
|
41771
|
41772
|
41773
|
41774
|
41809
|
41810
|
41811
|
41812
|
41813
|
41814
|
41815
|
41816
|
41817
|
41845
|
41848
|
41849
|
41850
|
41851
|
41852
|
41892
|
41893
|
41894
|
41895
|
41896
|
41897
|
41898
|
41899
|
41900
|
41901
|
41902
|
41903