[Koha-cvs] koha/C4 Search.pm [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Mon Oct 16 14:12:30 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/10/16 12:12:30

Modified files:
	C4             : Search.pm 

Log message:
	remove fonctions already writed on Members.pm

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.120.2.8&r2=1.120.2.9

Patches:
Index: Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.120.2.8
retrieving revision 1.120.2.9
diff -u -b -r1.120.2.8 -r1.120.2.9
--- Search.pm	16 Oct 2006 09:21:33 -0000	1.120.2.8
+++ Search.pm	16 Oct 2006 12:12:30 -0000	1.120.2.9
@@ -40,7 +40,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.120.2.8 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.120.2.9 $' =~ /\d+/g;
           shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -1797,49 +1797,6 @@
 	return ($cnt,\@results);
 }
 
-=item borrdata
-
-  $borrower = &borrdata($cardnumber, $borrowernumber);
-
-Looks up information about a patron (borrower) by either card number
-or borrower number. If $borrowernumber is specified, C<&borrdata>
-searches by borrower number; otherwise, it searches by card number.
-
-C<&borrdata> returns a reference-to-hash whose keys are the fields of
-the C<borrowers> table in the Koha database.
-
-=cut
-
-#'
-sub borrdata {
-  my ($cardnumber,$bornum)=@_;
-  $cardnumber = uc $cardnumber;
-  my $dbh = C4::Context->dbh;
-  my $sth;
-if ($bornum eq ''&& $cardnumber eq ''){ return undef; }
-  if ($bornum eq ''){
-    $sth=$dbh->prepare("Select * from borrowers where cardnumber=?");
-    $sth->execute($cardnumber);
-  } else {
-    $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
-  $sth->execute($bornum);
-  }
-  my $data=$sth->fetchrow_hashref;
-  $sth->finish;
-  if ($data) {
-  	return($data);
-	} else { # try with firstname
-		if ($cardnumber) {
-			my $sth=$dbh->prepare("select * from borrowers where firstname=?");
-			$sth->execute($cardnumber);
-			my $data=$sth->fetchrow_hashref;
-			$sth->finish;
-			return($data);
-		}
-	}
-	return undef;
-}
-
 =item borrissues
 
   ($count, $issues) = &borrissues($borrowernumber);
@@ -1918,81 +1875,6 @@
   return($i,\@result);
 }
 
-=item borrdata2
-
-  ($borrowed, $due, $fine) = &borrdata2($env, $borrowernumber);
-
-Returns aggregate data about items borrowed by the patron with the
-given borrowernumber.
-
-C<$env> is ignored.
-
-C<&borrdata2> returns a three-element array. C<$borrowed> is the
-number of books the patron currently has borrowed. C<$due> is the
-number of overdue items the patron currently has borrowed. C<$fine> is
-the total fine currently due by the borrower.
-
-=cut
-
-#'
-sub borrdata2 {
-  my ($env,$bornum)=@_;
-  my $dbh = C4::Context->dbh;
-  my $query="Select count(*) from issues where borrowernumber='$bornum' and
-    returndate is NULL";
-    # print $query;
-  my $sth=$dbh->prepare($query);
-  $sth->execute;
-  my $data=$sth->fetchrow_hashref;
-  $sth->finish;
-  $sth=$dbh->prepare("Select count(*) from issues where
-    borrowernumber='$bornum' and date_due < now() and returndate is NULL");
-  $sth->execute;
-  my $data2=$sth->fetchrow_hashref;
-  $sth->finish;
-  $sth=$dbh->prepare("Select sum(amountoutstanding) from accountlines where
-    borrowernumber='$bornum'");
-  $sth->execute;
-  my $data3=$sth->fetchrow_hashref;
-  $sth->finish;
-
-return($data2->{'count(*)'},$data->{'count(*)'},$data3->{'sum(amountoutstanding)'});
-}
-
-sub borrdata3 {
-  my ($env,$bornum)=@_;
-  my $dbh = C4::Context->dbh;
-  my $query="Select count(*) from  reserveissue as r where r.borrowernumber='$bornum' 
-     and rettime is null";
-    # print $query;
-  my $sth=$dbh->prepare($query);
-  $sth->execute;
-  my $data=$sth->fetchrow_hashref;
-  $sth->finish;
-  $sth=$dbh->prepare("Select count(*),timediff(now(),  duetime  ) as elapsed, hour(timediff(now(),  duetime  )) as hours, MINUTE(timediff(now(),  duetime  )) as min from 
-    reserveissue as r where  r.borrowernumber='$bornum' and rettime is null and duetime< now() group by r.borrowernumber");
-  $sth->execute;
-
-  my $data2=$sth->fetchrow_hashref;
-my $resfine;
-my $rescharge=C4::Context->preference('resmaterialcharge');
-if (!$rescharge){
-$rescharge=1;
-}
-if ($data2->{'elapsed'}>0){
- $resfine=($data2->{'hours'}+$data2->{'min'}/60)*$rescharge;
-$resfine=sprintf  ("%.1f",$resfine);
-}
-  $sth->finish;
-  $sth=$dbh->prepare("Select sum(amountoutstanding) from accountlines where
-    borrowernumber='$bornum'");
-  $sth->execute;
-  my $data3=$sth->fetchrow_hashref;
-  $sth->finish;
-
-
-return($data2->{'count(*)'},$data->{'count(*)'},$data3->{'sum(amountoutstanding)'},$resfine);
-}
 =item getboracctrecord
 
   ($count, $acctlines, $total) = &getboracctrecord($env, $borrowernumber);





More information about the Koha-cvs mailing list