Enable warnings in koha2marclinks.pl

Fix code generating warnings with warnings enabled

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Colin Campbell 2009-10-01 11:27:51 +01:00 committed by Galen Charlton
parent eee07ae861
commit 7f0f83a6ec

View file

@ -18,6 +18,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use warnings;
use C4::Output;
use C4::Auth;
use CGI;
@ -54,6 +55,7 @@ else {
script_name => $script_name,
else => 1
); # we show only the TMPL_VAR names $op
$op = q{};
}
my $dbh = C4::Context->dbh;
@ -61,9 +63,7 @@ my $dbh = C4::Context->dbh;
################## ADD_FORM ##################################
# called by default. Used to create form to add or modify a record
if ( $op eq 'add_form' ) {
my $data;
my $sth =
$dbh->prepare(
my $sth = $dbh->prepare(
"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where kohafield=?"
);
$sth->execute( $tablename . "." . $kohafield );
@ -71,8 +71,7 @@ if ( $op eq 'add_form' ) {
$sth->fetchrow;
for ( my $i = 0 ; $i <= 9 ; $i++ ) {
my $sth2 =
$dbh->prepare(
my $sth2 = $dbh->prepare(
"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where tagfield like ?"
);
$sth2->execute("$i%");
@ -84,7 +83,7 @@ if ( $op eq 'add_form' ) {
push @marcarray, "$field $tagsubfield - $liblibrarian";
}
my $marclist = CGI::scrolling_list(
-name => "marc",
-name => 'marc',
-values => \@marcarray,
-default =>
"$defaulttagfield $defaulttagsubfield - $defaultliblibrarian",
@ -124,13 +123,12 @@ elsif ( $op eq 'add_validate' ) {
else { # DEFAULT
my $sth =
$dbh->prepare(
"Select tagfield,tagsubfield,liblibrarian,kohafield from marc_subfield_structure"
q|select tagfield,tagsubfield,liblibrarian,kohafield from marc_subfield_structure where kohafield is not NULL and kohafield != ''|
);
$sth->execute;
my %fields;
while ( ( my $tagfield, my $tagsubfield, my $liblibrarian, my $kohafield ) =
$sth->fetchrow )
{
$sth->fetchrow ) {
$fields{$kohafield}->{tagfield} = $tagfield;
$fields{$kohafield}->{tagsubfield} = $tagsubfield;
$fields{$kohafield}->{liblibrarian} = $liblibrarian;