From 85777ba792dc203775ed1b18294a6d040c392fa2 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Mon, 11 Apr 2011 14:25:36 -0400 Subject: [PATCH] Bug 2505: quiet warnings in tools/inventory.pl Content-Type: text/plain; charset="UTF-8" --- tools/inventory.pl | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/inventory.pl b/tools/inventory.pl index aa792d3..cc7e8a7 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 (); -- 1.7.2.3