Fixed a few warnings.
[koha.git] / C4 / Koha.pm
1 package C4::Koha;
2
3 use strict;
4 require Exporter;
5
6 use vars qw($VERSION @ISA @EXPORT);
7   
8 $VERSION = 0.01;
9     
10 @ISA = qw(Exporter);
11 @EXPORT = qw(&slashifyDate
12              &fixEthnicity
13              $DEBUG); 
14
15 use vars qw();
16         
17 my $DEBUG = 0;
18
19 sub slashifyDate {
20     # accepts a date of the form xx-xx-xx[xx] and returns it in the 
21     # form xx/xx/xx[xx]
22     my @dateOut = split('-', shift);
23     return("$dateOut[2]/$dateOut[1]/$dateOut[0]")
24 }
25
26 sub fixEthnicity($) { # a temporary fix ethnicity, it should really be handled
27                       # in Search.pm or the DB ... 
28
29     my $ethnicity = shift;
30     if ($ethnicity eq 'maori') {
31         $ethnicity = 'Maori';
32     } elsif ($ethnicity eq 'european') {
33         $ethnicity = 'European/Pakeha';
34     } elsif ($ethnicity eq 'pi') {
35         $ethnicity = 'Pacific Islander'
36     } elsif ($ethnicity eq 'asian') {
37         $ethnicity = 'Asian';
38     }
39     return $ethnicity;
40 }
41
42
43 1;
44 __END__
45
46 =head1 NAME
47
48 Koha - Perl Module containing convenience functions for Koha scripts
49
50 =head1 SYNOPSIS
51
52   use Koha;
53
54
55   $date = slashifyDate("01-01-2002")
56
57
58
59 =head1 DESCRIPTION
60
61 Koha.pm provides many functions for Koha scripts.
62
63 slashifyDate() takes a dash separated date string and returns a slash 
64 separated date string
65
66 =head1 AUTHOR
67
68 Pat Eyler, pate@gnu.org
69
70 =head1 SEE ALSO
71
72 perl(1).
73
74 =cut
75
76
77
78
79