moved ethnicity fixing out of moremember.pl into a function,
eventually to replace with a more configurable version (non-NZ specific)
This commit is contained in:
parent
e1d7a81197
commit
2409d7fe90
1 changed files with 17 additions and 1 deletions
18
C4/Koha.pm
18
C4/Koha.pm
|
@ -8,7 +8,8 @@ use vars qw($VERSION @ISA @EXPORT);
|
||||||
$VERSION = 0.01;
|
$VERSION = 0.01;
|
||||||
|
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@EXPORT = qw(&slashifyDate);
|
@EXPORT = qw(&slashifyDate
|
||||||
|
&fixEthnicity);
|
||||||
|
|
||||||
use vars qw();
|
use vars qw();
|
||||||
|
|
||||||
|
@ -20,6 +21,21 @@ sub slashifyDate {
|
||||||
return("$dateOut[2]/$dateOut[1]/$dateOut[0]")
|
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;
|
1;
|
||||||
|
|
Loading…
Reference in a new issue