From 5849a03b30119d7b20f086ce8a535b951df6f9bd Mon Sep 17 00:00:00 2001 From: rangi Date: Wed, 13 Mar 2002 02:03:56 +0000 Subject: [PATCH] Fix so that reserves are only showing for the biblioitem not the biblio on the moremembers screen --- C4/Reserves2.pm | 25 ++++++++++++++++++++++++- moremember.pl | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/C4/Reserves2.pm b/C4/Reserves2.pm index 8f0e7dbd62..06a7408ea5 100755 --- a/C4/Reserves2.pm +++ b/C4/Reserves2.pm @@ -15,7 +15,8 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.01; @ISA = qw(Exporter); -@EXPORT = qw(&FindReserves &CreateReserve &updatereserves &getreservetitle); +@EXPORT = qw(&FindReserves &CreateReserve &updatereserves &getreservetitle +Findgroupreserve); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -89,6 +90,28 @@ sub FindReserves { return($i,\@results); } +sub Findgroupreserve { + my ($bibitem)=@_; + my $dbh=C4Connect; + $bibitem=$dbh->quote($bibitem); + my $query="Select * from reserves,reserveconstraints where + reserves.biblionumber=reservesconstraints.biblionumber and + and reserveconstraints.biblioitemnumber=$bibitem + and reserves.cancellationdate is NULL + and (reserves.found <> 'F' or reserves.found is NULL)"; + my $sth=$dbh->prepare($query); + $sth->execute; + my $i=0; + my @results; + while (my $data=$sth->fetchrow_hashref){ + $results[$i]=$data; + $i++; + } + $sth->finish; + $dbh->disconnect; + return($i,@results); +} + sub CreateReserve { my ($env,$branch,$borrnum,$biblionumber,$constraint,$bibitems,$priority,$notes,$title)= @_; diff --git a/moremember.pl b/moremember.pl index 3a7d2fdef6..7e1ed589f7 100755 --- a/moremember.pl +++ b/moremember.pl @@ -59,12 +59,25 @@ print <$data->{'title'} $data->{'othernames'} $data->{'surname'} ($data->{'firstname'}, $data->{'initials'})

Card Number: $data->{'cardnumber'}
+printend +; +if ($data->{'categorycode'} eq 'C'){ + my $data2=borrdata('',$data->{'guarantor'}); + $data->{'streetaddress'}=$data2->{'streetaddress'}; + $data->{'city'}=$data2->{'city'}; + $data->{'physstreet'}=$data2->{'phystreet'}; + $data->{'streetcity'}=$data2->{'streetcity'}; + $data->{'phone'}=$data2->{'phone'}; + $data->{'phoneday'}=$data2->{'phoneday'}; +} +print <{'streetaddress'}, $data->{'city'}
Home Address: $data->{'physstreet'}, $data->{'streetcity'}
Phone (Home): $data->{'phone'}
Phone (Daytime): $data->{'phoneday'}
Fax: $data->{'faxnumber'}
-E-mail: $data->{'emailaddress'}

+E-mail: $data->{'emailaddress'}
+Textmessaging:$data->{'textmessaging'}

Membership Number: $data->{'borrowernumber'}
Membership: $data->{'categorycode'}
Area: $data->{'area'}
@@ -79,12 +92,23 @@ Alternative Contact:$data->{'contactname'}
Phone: $data->{'altphone'}
Relationship: $data->{'altrelationship'}
Notes: $data->{'altnotes'}

-Guarantees: printend ; -my ($count,$guarantees)=findguarantees($data->{'borrowernumber'}); -for (my $i=0;$i<$count;$i++){ - print "[$i]->{'borrowernumber'}\">$guarantees->[$i]->{'cardnumber'}
"; + +if ($data->{'categorycode'} ne 'C'){ + print " Guarantees:"; + my ($count,$guarantees)=findguarantees($data->{'borrowernumber'}); + for (my $i=0;$i<$count;$i++){ + print "[$i]->{'borrowernumber'}\">$guarantees->[$i]->{'cardnumber'}
"; + } +} else { + print "Guarantor:"; + my ($guarantor)=findguarantor($data->{'borrowernumber'}); + if ($guarantor->{'borrowernumber'} == 0){ + print "no guarantor
"; + } else { + print "{'borrowernumber'}\">$guarantor->{'cardnumber'}
"; + } } print <   "; # } #check item is not reserved - my ($rescount,$reserves)=FindReserves($issue->[$i]{'biblionumber'},''); + my ($rescount,$reserves)=Findgroupreserve($issue->[$i]{'biblionumber'},''); if ($rescount >0){ print "[$i]{'biblionumber'}>On Request - no renewals"; # } elsif ($issue->[$i]->{'renewals'} > 0) { @@ -257,7 +281,7 @@ for (my $i=0;$i<$rescount;$i++){ @temp=split('-',$reserves->[$i]{'reservedate'}); $reserves->[$i]{'reservedate'}="$temp[2]/$temp[1]/$temp[0]"; print " - [$i]{'biblionumber'}\">$reserves->[$i]{'title'} + [$i]{'biblionumber'}\">$reserves->[$i]{'btitle'} $reserves->[$i]{'reservedate'} [$i]{'biblionumber'}> -- 2.39.5