moved ethnicity fixing out of moremember.pl into a function,
authorpate <pate>
Mon, 15 Apr 2002 16:15:38 +0000 (16:15 +0000)
committerpate <pate>
Mon, 15 Apr 2002 16:15:38 +0000 (16:15 +0000)
eventually to replace with a more configurable version (non-NZ specific)

C4/Koha.pm

index 96452f4..41f1fa7 100644 (file)
@@ -8,7 +8,8 @@ use vars qw($VERSION @ISA @EXPORT);
 $VERSION = 0.01;
     
 @ISA = qw(Exporter);
-@EXPORT = qw(&slashifyDate); 
+@EXPORT = qw(&slashifyDate
+            &fixEthnicity); 
 
 use vars qw();
        
@@ -20,6 +21,21 @@ sub slashifyDate {
     return("$dateOut[2]/$dateOut[1]/$dateOut[0]")
 }
 
+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 ($ehtnicity eq 'asian') {
+       $ethnicity = 'Asian';
+    }
+    return $ethnicity;
+}
 
 
 1;