7 use vars qw($VERSION @ISA @EXPORT);
12 @EXPORT = qw(&slashifyDate
23 # accepts a date of the form xx-xx-xx[xx] and returns it in the
25 my @dateOut = split('-', shift);
26 return("$dateOut[2]/$dateOut[1]/$dateOut[0]")
31 my $ethnicity = shift;
33 my $sth=$dbh->prepare("Select name from ethnicity where code = ?");
34 $sth->execute($ethnicity);
35 my $data=$sth->fetchrow_hashref;
38 return $data->{'name'};
41 sub borrowercategories {
43 my $sth=$dbh->prepare("Select categorycode,description from categories order by description");
47 while (my $data=$sth->fetchrow_hashref){
48 push @codes,$data->{'categorycode'};
49 $labels{$data->{'categorycode'}}=$data->{'description'};
53 return(\@codes,\%labels);
56 sub ethnicitycategories {
58 my $sth=$dbh->prepare("Select code,name from ethnicity order by name");
62 while (my $data=$sth->fetchrow_hashref){
63 push @codes,$data->{'code'};
64 $labels{$data->{'code'}}=$data->{'name'};
68 return(\@codes,\%labels);
76 Koha - Perl Module containing convenience functions for Koha scripts
83 $date = slashifyDate("01-01-2002")
84 $ethnicity=fixEthnicity('asian');
85 ($categories,$labels)=borrowercategories();
89 Koha.pm provides many functions for Koha scripts.
91 slashifyDate() takes a dash separated date string and returns a slash
96 Pat Eyler, pate@gnu.org