[Koha-cvs] CVS: koha/C4/Circulation Circ2.pm,1.57,1.58
Paul POULAIN
tipaul at users.sourceforge.net
Thu Jun 5 19:03:37 CEST 2003
Update of /cvsroot/koha/koha/C4/Circulation
In directory sc8-pr-cvs1:/tmp/cvs-serv19413/C4/Circulation
Modified Files:
Circ2.pm
Log Message:
removing searchborrower from circ2.pm.
Already exists in Search.pm
this fixes bug #439 and improve consistency.
Index: Circ2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** Circ2.pm 8 May 2003 12:48:23 -0000 1.57
--- Circ2.pm 5 Jun 2003 17:03:34 -0000 1.58
***************
*** 62,66 ****
@ISA = qw(Exporter);
@EXPORT = qw(&getpatroninformation
! ¤tissues &getissues &getiteminformation &findborrower
&issuebook &returnbook &find_reserves &transferbook &decode
&calc_charges);
--- 62,66 ----
@ISA = qw(Exporter);
@EXPORT = qw(&getpatroninformation
! ¤tissues &getissues &getiteminformation
&issuebook &returnbook &find_reserves &transferbook &decode
&calc_charges);
***************
*** 301,352 ****
return($iteminformation);
}
-
- =item findborrower
-
- $borrowers = &findborrower($env, $key);
- print $borrowers->[0]{surname};
-
- Looks up patrons and returns information about them.
-
- C<$env> is ignored.
-
- C<$key> is either a card number or a string. C<&findborrower> tries to
- look it up as a card number first. If that fails, C<&findborrower>
- looks up all patrons whose surname begins with C<$key>.
-
- C<$borrowers> is a reference-to-array. Each element is a
- reference-to-hash whose keys are the fields of the borrowers table in
- the Koha database.
-
- =cut
- #'
- # If you really want to throw a monkey wrench into the works, change
- # your last name to "V10000008" :-)
-
- # FIXME - This is different from &C4::Borrower::findborrower, but I
- # think that one's obsolete.
- sub findborrower {
- # returns an array of borrower hash references, given a cardnumber or a partial
- # surname
- my ($env, $key) = @_;
- my $dbh = C4::Context->dbh;
- my @borrowers;
- my $sth=$dbh->prepare("select * from borrowers where cardnumber=?");
- $sth->execute($key);
- if ($sth->rows) {
- my ($borrower)=$sth->fetchrow_hashref;
- push (@borrowers, $borrower);
- } else {
- $sth->finish;
- $sth=$dbh->prepare("select * from borrowers where surname like ?");
- $sth->execute($key."%");
- while (my $borrower = $sth->fetchrow_hashref) {
- push (@borrowers, $borrower);
- }
- }
- $sth->finish;
- return(\@borrowers);
- }
-
=item transferbook
--- 301,304 ----
More information about the Koha-cvs
mailing list