From 827b8c4c466101f1d5d3ca3553964bdcf3799bf6 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Mon, 29 Nov 2010 10:37:15 +0000 Subject: [PATCH] Bug 5453 Do not declare variables in conditionals Removed occurences in acqui/*.pl Signed-off-by: Chris Cormack --- acqui/basketgroup.pl | 16 ++++++---------- acqui/histsearch.pl | 14 ++++++++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 457b61606d..08356f85b0 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -305,26 +305,22 @@ if ( $op eq "add" ) { # Build the combobox to select the billing place my @billingplaceloop; for (sort keys %$branches) { - my $selected = 1 if $_ eq $billingplace; - my %row = ( + push @billingplaceloop, { value => $_, - selected => $selected, + selected => $_ eq $billingplace, branchname => $branches->{$_}->{branchname}, - ); - push @billingplaceloop, \%row; + }; } $template->param( billingplaceloop => \@billingplaceloop ); # Build the combobox to select the delivery place my @deliveryplaceloop; for (sort keys %$branches) { - my $selected = 1 if $_ eq $deliveryplace; - my %row = ( + push @deliveryplaceloop, { value => $_, - selected => $selected, + selected => $_ eq $deliveryplace, branchname => $branches->{$_}->{branchname}, - ); - push @deliveryplaceloop, \%row; + }; } $template->param( deliveryplaceloop => \@deliveryplaceloop ); diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index 0190e4a688..2c417421e1 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -75,11 +75,17 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $from_iso = C4::Dates->new($input->param('from'))->output('iso') if $input->param('from'); -my $to_iso = C4::Dates->new($input->param('to'))->output('iso') if $input->param('iso'); +my ( $from_iso, $to_iso, $d ); +if ( $d = $input->param('from') ) { + $from_iso = C4::Dates->new($d)->output('iso'); +} +if ( $d = $input->param('iso') ) { + $to_iso = C4::Dates->new($d)->output('iso'); +} + my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = - &GetHistory( $title, $author, $name, $from_iso, $to_iso ); - + GetHistory( $title, $author, $name, $from_iso, $to_iso ); + $template->param( suggestions_loop => $order_loop, total_qty => $total_qty, -- 2.39.5