[Koha] Script Modifications
Larry Currie
lcurrie at CalAcademy.org
Thu Feb 7 10:10:37 NZDT 2002
I am attempting to modify some of the Perl scripts in Koha so that they
conform to our local conditions. In the moremember.pl script, for
instance, I have changed the ethnic classifications and I rewrote the
checkdigit subroutine to reflect the type of patron barcodes we use.
But I am not seeing these changes reflected in the koha intranet when I
attempt to register new patrons. What do I need to do in order to have
these changes take effect? I stopped and restarted the Apache server
thinking that this would do it, but to no avail. The text of my changes
is given below.
Larry Currie
Changes made to Perl script moremember.pl:
my %env;
print $input->header;
#start the page and read in includes
print startpage();
print startmenu('member');
my $data=borrdata('',$bornum);
my @temp=split('-',$data->{'dateenrolled'});
$data->{'dateenrolled'}="$temp[2]/$temp[1]/$temp[0]";
@temp=split('-',$data->{'expiry'});
$data->{'expiry'}="$temp[2]/$temp[1]/$temp[0]";
@temp=split('-',$data->{'dateofbirth'});
$data->{'dateofbirth'}="$temp[2]/$temp[1]/$temp[0]";
if ($data->{'ethnicity'} eq 'white'){
$data->{'ethnicity'} = 'White';
}
if ($data->{'ethnicity'}eq 'black'){
$data->{'ethnicity'} = 'Black';
}
if ($data->{'ethnicity'}eq 'american indian'){
$data->{'ethnicity'} = 'American Indian';
}
if ($data->{'ethnicity'}eq 'asian and pacific islander'){
$data->{'ethnicity'} = 'Asian and Pacific Islander';
}
print <<printend
Changes made to subroutine checkdigit in Input.pm:
sub checkdigit {
my ($env,$infl) = @_;
$infl = uc $infl;
my $sum1;
my $sum2;
my $sum3;
my $i = 0;
my $j = 1;
my $valid = 0;
# print $infl."<br>";
while ($i <14) {
my $temp1 = substr($infl,$i,1);
if ($temp1 = 0) {
$temp1 = 0;
} elsif ($temp1 = 1) {
$temp1 = 2;
} elsif ($temp1 = 2) {
$temp1 = 4;
} elsif ($temp1 = 3) {
$temp1 = 6;
} elsif ($temp1 = 4) {
$temp1 = 8;
} elsif ($temp1 = 5) {
$temp1 = 0;
} elsif ($temp1 = 6) {
$temp1 = 3;
} elsif ($temp1 = 7) {
$temp1 = 5;
} elsif ($temp1 = 8) {
$temp1 = 7;
} elsif ($temp1 = 9) {
$temp1 = 9;
$sum1 = $sum1 + $temp1;
# print "$sum $temp1 $temp2<br>";
$i = $i + 2;
}
while ($j < 13) {
my $temp2 = substr($infl,$j,1);
$sum2 = $sum2 + $temp2;
$j = $j + 2;
}
$sum3 = $sum1 + $sum2;
my $rem = 10 - ($sum3%10);
}
#print $rem."<br>";
if ($rem eq substr($infl,13,1)) {
$valid = 1;
}
return $valid;
}
END { } # module clean-up code here (global destructor)
--
Lawrence W. Currie
User Services Librarian
California Academy of Sciences
Golden Gate Park
San Francisco, CA 94118
lcurrie at calacademy.org
(415) 750-7108
(415) 750-7106 fax
http://www.calacademy.org/research/library/
More information about the Koha
mailing list