From 4532ca70bc5842667c6ff53d9fec5d7e7b4f4317 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 17 Jan 2011 09:45:41 +0000 Subject: [PATCH] Bug 5399: remove useless eval 'use C4::Foo' Also add a couple FIXMEs Marcel: Signed and updated for current master Signed-off-by: Galen Charlton Signed-off-by: Marcel de Rooy Signed-off-by: Chris Cormack --- acqui/addorderiso2709.pl | 6 +----- acqui/basketgroup.pl | 7 ++++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 781df61a22..29f8143576 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -37,7 +37,7 @@ use C4::Biblio; use C4::Items; use C4::Koha qw/GetItemTypes/; use C4::Budgets qw/GetBudgets/; -use C4::Acquisition qw/NewOrderItem/; +use C4::Acquisition qw/NewOrderItem GetBasket/; use C4::Bookseller qw/GetBookSellerFromId/; my $input = new CGI; @@ -145,8 +145,6 @@ if ($op eq ""){ if ($orderinfo{'listprice'} =~ /^([\d\.,]*)/) { $orderinfo{'listprice'} = $1; $orderinfo{'listprice'} =~ s/,/\./; - eval "use C4::Acquisition qw/GetBasket/;"; - eval "use C4::Bookseller qw/GetBookSellerFromId/;"; my $basket = GetBasket($orderinfo{basketno}); my $bookseller = GetBookSellerFromId($basket->{booksellerid}); # '//' is like '||' but tests for defined, rather than true @@ -163,8 +161,6 @@ if ($op eq ""){ if ($orderinfo{'listprice'} =~ /^([\d\.,]*)/) { $orderinfo{'listprice'} = $1; $orderinfo{'listprice'} =~ s/,/\./; - eval "use C4::Acquisition qw/GetBasket/;"; - eval "use C4::Bookseller qw/GetBookSellerFromId/;"; my $basket = GetBasket($orderinfo{basketno}); my $bookseller = GetBookSellerFromId($basket->{booksellerid}); my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index aba32d4c6e..0d5bcd585a 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -183,8 +183,9 @@ sub printbasketgrouppdf{ my ($basketgroupid) = @_; my $pdfformat = C4::Context->preference("OrderPdfFormat"); - eval "use $pdfformat" ; - eval "use C4::Branch"; + eval "use $pdfformat"; + # FIXME consider what would happen if $pdfformat does not + # contain the name of a valid Perl module. my $basketgroup = GetBasketgroup($basketgroupid); my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'}); @@ -244,7 +245,7 @@ sub printbasketgrouppdf{ ); my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed"; print $pdf; - exit; + exit; # FIXME bad form to exit out of a subroutine like this } my $op = $input->param('op'); -- 2.39.5