From 9475752f3ad2d16b6097b47437cf7c33b1f882f3 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Mon, 11 Apr 2011 14:26:24 -0400 Subject: [PATCH] Bug 2505: quiet warnings in tools/inventory.pl Signed-off-by: Chris Cormack --- tools/inventory.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/inventory.pl b/tools/inventory.pl index f8903e5e7b..30720e6c1b 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -39,7 +39,7 @@ use C4::Circulation; my $minlocation=$input->param('minlocation') || ''; my $maxlocation=$input->param('maxlocation'); $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); -my $location=$input->param('location'); +my $location=$input->param('location') || ''; my $itemtype=$input->param('itemtype'); # FIXME note, template does not currently supply this my $ignoreissued=$input->param('ignoreissued'); my $datelastseen = $input->param('datelastseen'); @@ -48,7 +48,7 @@ my $markseen = $input->param('markseen'); $offset=0 unless $offset; my $pagesize = $input->param('pagesize'); $pagesize=50 unless $pagesize; -my $branchcode = $input->param('branchcode'); +my $branchcode = $input->param('branchcode') || ''; my $branch = $input->param('branch'); my $op = $input->param('op'); my $res; #contains the results loop @@ -74,7 +74,7 @@ for my $branch_hash (keys %$branches) { @branch_loop = sort {$a->{branchname} cmp $b->{branchname}} @branch_loop; my @authorised_value_list; -my $authorisedvalue_categories; +my $authorisedvalue_categories = ''; my $frameworks = getframeworks(); for my $fwk (keys %$frameworks){ @@ -106,7 +106,7 @@ my $staton = {}; #authorized values that are ticked for my $authvfield (@$statuses) { $staton->{$authvfield->{fieldname}} = []; for my $authval (@{$authvfield->{values}}){ - if ( $input->param('status-' . $authvfield->{fieldname} . '-' . $authval->{id}) eq 'on' ){ + if ( defined $input->param('status-' . $authvfield->{fieldname} . '-' . $authval->{id}) && $input->param('status-' . $authvfield->{fieldname} . '-' . $authval->{id}) eq 'on' ){ push @{$staton->{$authvfield->{fieldname}}}, $authval->{id}; } } @@ -191,7 +191,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa prevoffset => ($offset?$offset-$pagesize:0), ); } - if ( ( ( $input->param('compareinv2barcd') eq 'on' ) && ( scalar @brcditems != scalar @$res ) ) && length($uploadbarcodes) > 0 ){ + if ( defined $input->param('compareinv2barcd') && ( ( $input->param('compareinv2barcd') eq 'on' ) && ( scalar @brcditems != scalar @$res ) ) && length($uploadbarcodes) > 0 ){ if ( scalar @brcditems > scalar @$res ){ for my $brcditem (@brcditems) { if (! grep(/$brcditem->{barcode}/, @$res) ){ @@ -212,7 +212,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa } } -if ($input->param('CSVexport') eq 'on'){ +if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ eval {use Text::CSV}; my $csv = Text::CSV->new or die Text::CSV->error_diag (); -- 2.39.5