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

Antoine Farnault antoine at koha-fr.org
Mon Nov 27 16:14:52 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/11/27 15:14:52

Modified files:
	C4             : Search.pm 

Log message:
	removing bornameSearch from Search.pm. This function is 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.30&r2=1.120.2.31

Patches:
Index: Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.120.2.30
retrieving revision 1.120.2.31
diff -u -b -r1.120.2.30 -r1.120.2.31
--- Search.pm	21 Nov 2006 11:06:45 -0000	1.120.2.30
+++ Search.pm	27 Nov 2006 15:14:52 -0000	1.120.2.31
@@ -39,7 +39,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.30 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.120.2.31 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -66,7 +66,7 @@
 @EXPORT = qw(
   &CatSearch
   &SimpleSearch
-  &BornameSearch &ItemInfo &KeywordSearch
+  &ItemInfo &KeywordSearch
   &subsearch
   &itemdata &bibdata
   &GetItems &borrdata &itemnodata
@@ -1868,86 +1868,6 @@
     return ($data);
 }
 
-=item BornameSearch
-
-  ($count, $borrowers) = &BornameSearch($env, $searchstring, $type);
-
-Looks up patrons (borrowers) by name.
-
-C<$env> is ignored.
-
-BUGFIX 499: C<$type> is now used to determine type of search.
-if $type is "simple", search is performed on the first letter of the
-surname only.
-
-C<$searchstring> is a space-separated list of search terms. Each term
-must match the beginning a borrower's surname, first name, or other
-name.
-
-C<&BornameSearch> returns a two-element list. C<$borrowers> is a
-reference-to-array; each element is a reference-to-hash, whose keys
-are the fields of the C<borrowers> table in the Koha database.
-C<$count> is the number of elements in C<$borrowers>.
-
-=cut
-
-#'
-#used by member enquiries from the intranet
-#called by member.pl
-sub BornameSearch {
-    my ( $env, $searchstring, $orderby, $type ) = @_;
-    my $dbh   = C4::Context->dbh;
-    my $query = "";
-    my $count;
-    my @data;
-    my @bind = ();
-
-    if ( $type eq "simple" )    # simple search for one letter only
-    {
-        $query =
-"Select * from borrowers where surname like '$searchstring%' order by $orderby";
-
-        #        @bind=("$searchstring%");
-    }
-    else    # advanced search looking in surname, firstname and othernames
-    {
-### Try to determine whether numeric like cardnumber
-        if ( $searchstring + 1 > 1 ) {
-            $query =
-"Select * from borrowers where  cardnumber  like '$searchstring%' ";
-
-        }
-        else {
-
-            my @words = split / /, $searchstring;
-            foreach my $word (@words) {
-                $word = "+" . $word;
-
-            }
-            $searchstring = join " ", @words;
-
-            $query =
-"Select * from borrowers where  MATCH(surname,firstname,othernames) AGAINST('$searchstring'  in boolean mode)";
-
-        }
-        $query = $query . " order by $orderby";
-    }
-
-    my $sth = $dbh->prepare($query);
-
-    #    warn "Q $orderby : $query";
-    $sth->execute();
-    my @results;
-    my $cnt = $sth->rows;
-    while ( my $data = $sth->fetchrow_hashref ) {
-        push( @results, $data );
-    }
-
-    #  $sth->execute;
-    $sth->finish;
-    return ( $cnt, \@results );
-}
-
 =item getboracctrecord
 
   ($count, $acctlines, $total) = &getboracctrecord($env, $borrowernumber);





More information about the Koha-cvs mailing list