koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha C4/Members.pm serials/distributedto.pl


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha C4/Members.pm serials/distributedto.pl
Date: Wed, 25 Apr 2007 13:38:00 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Changes by:     Henri-Damien LAURENT <hdl>      07/04/25 13:38:00

Modified files:
        C4             : Members.pm 
        serials        : distributedto.pl 

Log message:
        Deleting GetMembersFromSurname
        Using SearchMember instead.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/koha/serials/distributedto.pl?cvsroot=koha&r1=1.8&r2=1.9

Patches:
Index: C4/Members.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Members.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- C4/Members.pm       24 Apr 2007 16:10:36 -0000      1.49
+++ C4/Members.pm       25 Apr 2007 13:38:00 -0000      1.50
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Members.pm,v 1.49 2007/04/24 16:10:36 tipaul Exp $
+# $Id: Members.pm,v 1.50 2007/04/25 13:38:00 hdl Exp $
 
 use strict;
 require Exporter;
@@ -31,7 +31,7 @@
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
-$VERSION = do { my @v = '$Revision: 1.49 $' =~ /\d+/g; shift(@v) . "." . join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.50 $' =~ /\d+/g; shift(@v) . "." . join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -73,17 +73,16 @@
   &GetCities 
   &GetRoadTypes 
   &GetRoadTypeDetails 
+  &GetSortDetails
+  &GetTitles   
   
   &GetMemberAccountRecords
+  &GetBorNotifyAcctRecord
   
   &GetborCatFromCatType 
   &GetBorrowercategory
   
-  &GetBorNotifyAcctRecord
-  &ExtendMemberSubscriptionTo 
-  &GetSortDetails
   
-  &GetTitles   
   &GetBorrowersWhoHaveNotBorrowedSince
   &GetBorrowersWhoHaveNeverBorrowed
   &GetBorrowersWithIssuesHistoryOlderThan
@@ -95,7 +94,6 @@
 #Modify data
 push @EXPORT, qw(
   &ModMember
-  &fixup_cardnumber
   &changepassword
 );
   
@@ -107,15 +105,19 @@
 #Insert data
 push @EXPORT, qw(
   &AddMember  
+  &add_member_orgs
+  &MoveMemberToDeleted
+  &ExtendMemberSubscriptionTo 
+);
+
+#Check data
+push @EXPORT, qw(
   &checkuniquemember 
   &checkuserpassword
   &fixEthnicity
   &ethnicitycategories 
-  &add_member_orgs
-  
-  &MoveMemberToDeleted
+  &fixup_cardnumber
 );
-
 =item SearchMember
 
   ($count, $borrowers) = &SearchMember($searchstring, $type,$category_type);
@@ -197,14 +199,10 @@
     #  warn "Q $orderby : $query";
     $sth->execute(@bind);
     my @results;
-    my $cnt = $sth->rows;
-    while ( my $data = $sth->fetchrow_hashref ) {
-        push( @results, $data );
-    }
+    my $data = $sth->fetchall_arrayref({});
 
-    #  $sth->execute;
     $sth->finish;
-    return ( $cnt, address@hidden );
+    return ( scalar(@$data), $data );
 }
 
 =head2 GetMemberDetails
@@ -1352,7 +1350,9 @@
     my $dbh       = C4::Context->dbh;
     my $sth       =
       $dbh->prepare(
-"SELECT description,dateofbirthrequired,upperagelimit,category_type FROM 
categories WHERE categorycode = ?"
+"SELECT description,dateofbirthrequired,upperagelimit,category_type 
+ FROM categories 
+ WHERE categorycode = ?"
       );
     $sth->execute($catcode);
     my $data =
@@ -1486,39 +1486,6 @@
 
 =head2 GetMembersFromSurname
 
-=over 4
-
address@hidden = GetMembersFromSurname($surname)
-this function get the list of borrower names like $surname.
-return :
-the table of results in @results
-
-=back
-
-=cut
-
-sub GetMembersFromSurname {
-    my ($searchstring) = @_;
-    my $dbh = C4::Context->dbh;
-    $searchstring =~ s/\'/\\\'/g;
-    my @data  = split( ' ', $searchstring );
-    my $count = @data;
-    my $query = qq|
-        SELECT   surname,firstname
-        FROM     borrowers
-        WHERE    (surname like ?)
-        ORDER BY surname
-    |;
-    my $sth = $dbh->prepare($query);
-    $sth->execute("$data[0]%");
-    my @results;
-    $count = 0;
-
-    my $data = $sth->fetchall_arrayref({});
-    $sth->finish;
-    return ( scalar(@$data), $data );
-}
-
 =head2 GetCities (OUEST-PROVENCE)
 
   ($id_cityarrayref, $city_hashref) = &GetCities();
@@ -1609,7 +1576,7 @@
     my @data = $sth->fetchrow_array;
     $sth->finish;
     $sth =
-      $dbh->prepare( "Insert into deletedborrowers values ("
+      $dbh->prepare( "INSERT INTO deletedborrowers VALUES ("
           . ( "?," x ( scalar(@data) - 1 ) )
           . "?)" );
     $sth->execute(@data);
@@ -1684,9 +1651,10 @@
 
 sub GetRoadTypes {
     my $dbh   = C4::Context->dbh;
-    my $query = qq|SELECT roadtypeid,road_type 
-               FROM roadtype 
-               ORDER BY road_type|;
+    my $query = qq|
+SELECT roadtypeid,road_type 
+FROM roadtype 
+ORDER BY road_type|;
     my $sth = $dbh->prepare($query);
     $sth->execute();
     my %roadtype;
@@ -1743,9 +1711,10 @@
 sub GetRoadTypeDetails {
     my ($roadtypeid) = @_;
     my $dbh          = C4::Context->dbh;
-    my $query        = qq|SELECT road_type 
-               FROM roadtype 
-               WHERE roadtypeid=?|;
+    my $query        = qq|
+SELECT road_type 
+FROM roadtype 
+WHERE roadtypeid=?|;
     my $sth = $dbh->prepare($query);
     $sth->execute($roadtypeid);
     my $roadtype = $sth->fetchrow;

Index: serials/distributedto.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/distributedto.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- serials/distributedto.pl    24 Apr 2007 15:41:27 -0000      1.8
+++ serials/distributedto.pl    25 Apr 2007 13:38:00 -0000      1.9
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: distributedto.pl,v 1.8 2007/04/24 15:41:27 hdl Exp $
+# $Id: distributedto.pl,v 1.9 2007/04/25 13:38:00 hdl Exp $
 
 =head1 NAME
 
@@ -79,7 +79,7 @@
                  debug => 1,
                  });
 
-my ($count,$results)=GetMembersFromSurname($searchfield) if $searchfield;
+my ($count,$results)=SearchMember($searchfield,"firstname","simple",) if 
$searchfield;
 my $toggle="0";
 my @loop_data =();
 for (my $i=0; $i < $count; $i++){




reply via email to

[Prev in Thread] Current Thread [Next in Thread]