From 2409d7fe90a6d33f61a0cc5b527d7fdf855a7257 Mon Sep 17 00:00:00 2001 From: pate Date: Mon, 15 Apr 2002 16:15:38 +0000 Subject: [PATCH] moved ethnicity fixing out of moremember.pl into a function, eventually to replace with a more configurable version (non-NZ specific) --- C4/Koha.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 96452f4b69..41f1fa7c2e 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -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; -- 2.39.5