[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Koha.pm,1.4.2.1,1.4.2.2
From: |
Chris Cormack |
Subject: |
[Koha-cvs] CVS: koha/C4 Koha.pm,1.4.2.1,1.4.2.2 |
Date: |
Thu, 23 May 2002 03:05:14 -0700 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv25846/C4
Modified Files:
Tag: rel-1-2
Koha.pm
Log Message:
Removing hardcoded ethnicity and category lists.
Fetched from the database instead.
Need to do the same for area
Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -r1.4.2.1 -r1.4.2.2
*** Koha.pm 18 May 2002 09:53:40 -0000 1.4.2.1
--- Koha.pm 23 May 2002 10:05:11 -0000 1.4.2.2
***************
*** 12,15 ****
--- 12,17 ----
@EXPORT = qw(&slashifyDate
&fixEthnicity
+ &borrowercategories
+ ðnicitycategories
$DEBUG);
***************
*** 37,40 ****
--- 39,71 ----
}
+ sub borrowercategories {
+ my $dbh=C4Connect;
+ my $sth=$dbh->prepare("Select categorycode,description from categories
order by description");
+ $sth->execute;
+ my %labels;
+ my @codes;
+ while (my $data=$sth->fetchrow_hashref){
+ push @codes,$data->{'categorycode'};
+ $labels{$data->{'categorycode'}}=$data->{'description'};
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ return(address@hidden,\%labels);
+ }
+
+ sub ethnicitycategories {
+ my $dbh=C4Connect;
+ my $sth=$dbh->prepare("Select code,name from ethnicity order by name");
+ $sth->execute;
+ my %labels;
+ my @codes;
+ while (my $data=$sth->fetchrow_hashref){
+ push @codes,$data->{'code'};
+ $labels{$data->{'code'}}=$data->{'name'};
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ return(address@hidden,\%labels);
+ }
1;
***************
*** 51,56 ****
$date = slashifyDate("01-01-2002")
!
!
=head1 DESCRIPTION
--- 82,87 ----
$date = slashifyDate("01-01-2002")
! $ethnicity=fixEthnicity('asian');
! ($categories,$labels)=borrowercategories();
=head1 DESCRIPTION
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Koha.pm,1.4.2.1,1.4.2.2,
Chris Cormack <=