[Koha-cvs] CVS: koha/C4 Koha.pm,1.4,1.4.2.1

Chris Cormack rangi at users.sourceforge.net
Sat May 18 11:53:42 CEST 2002


Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv636/C4

Modified Files:
      Tag: rel-1-2
	Koha.pm 
Log Message:
Shifting ethnicity into a table in the database. Making fixEthnicity fetch
the data from the db


Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -r1.4 -r1.4.2.1
*** Koha.pm	22 Apr 2002 22:47:09 -0000	1.4
--- Koha.pm	18 May 2002 09:53:40 -0000	1.4.2.1
***************
*** 3,6 ****
--- 3,7 ----
  use strict;
  require Exporter;
+ use C4::Database;
  
  use vars qw($VERSION @ISA @EXPORT);
***************
*** 24,41 ****
  }
  
! sub fixEthnicity($) { # a temporary fix ethnicity, it should really be handled
!                       # in Search.pm or the DB ... 
  
      my $ethnicity = shift;
!     if ($ethnicity eq 'maori') {
! 	$ethnicity = 'Maori';
!     } elsif ($ethnicity eq 'european') {
! 	$ethnicity = 'European/Pakeha';
!     } elsif ($ethnicity eq 'pi') {
! 	$ethnicity = 'Pacific Islander'
!     } elsif ($ethnicity eq 'asian') {
! 	$ethnicity = 'Asian';
!     }
!     return $ethnicity;
  }
  
--- 25,38 ----
  }
  
! sub fixEthnicity($) { 
  
      my $ethnicity = shift;
!     my $dbh=C4Connect;
!     my $sth=$dbh->prepare("Select name from ethnicity where code = ?");
!     $sth->execute($ethnicity);
!     my $data=$sth->fetchrow_hashref;
!     $sth->finish;
!     $dbh->disconnect;
!     return $data->{'name'};
  }
  





More information about the Koha-cvs mailing list