From: Colin Campbell Date: Wed, 2 Oct 2013 08:25:16 +0000 (+0100) Subject: Bug 10983: Remove unused private subroutines from C4::Budgets X-Git-Tag: v3.16.00-beta~1087 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=befc07c754eb4c2199c0063f15f9ffb3f3ea8cca;p=koha_fer Bug 10983: Remove unused private subroutines from C4::Budgets The subroutine _filter_fields is not used by the module and the sub _columns is only used by it This patch removes the dead code. To test: [1] Verify that the following tests pass t/Budgets.t t/Budgets/CanUserModifyBudget.t t/Budgets/CanUserUseBudget.t t/db_dependent/Acquisition.t t/db_dependent/Acquisition/GetOrdersByBiblionumber.t t/db_dependent/Acquisition/Invoices.t t/db_dependent/Acquisition/OrderFromSubscription.t t/db_dependent/Acquisition/TransferOrder.t t/db_dependent/Acquisition/close_reopen_basket.t t/db_dependent/Bookseller.t t/db_dependent/Budgets.t t/db_dependent/Serials.t t/db_dependent/Serials_2.t Signed-off-by: Galen Charlton Signed-off-by: Jonathan Druart Looks good to me. Signed-off-by: Galen Charlton --- diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 334e6108cf..758e98f5dd 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -981,37 +981,6 @@ sub ConvertCurrency { return ( $price / $cur ); } -=head2 _columns - -returns an array containing fieldname followed by PRI as value if PRIMARY Key - -=cut - -sub _columns(;$) { - my $tablename=shift||"aqbudgets"; - return @{C4::Context->dbh->selectcol_arrayref("SHOW columns from $tablename",{Columns=>[1,4]})}; -} - -sub _filter_fields{ - my $budget=shift; - my $tablename=shift; - my @keys; - my @values; - my %columns= _columns($tablename); - #Filter Primary Keys of table - my $elements=join "|",grep {$columns{$_} ne "PRI"} keys %columns; - foreach my $field (grep {/\b($elements)\b/} keys %$budget){ - $$budget{$field}=format_date_in_iso($$budget{$field}) if ($field=~/date/ && $$budget{$field} !~C4::Dates->regexp("iso")); - my $strkeys= " $field = ? "; - if ($field=~/branch/){ - $strkeys="( $strkeys OR $field='' OR $field IS NULL) "; - } - push @values, $$budget{$field}; - push @keys, $strkeys; - } - return (\@keys,\@values); -} - END { } # module clean-up code here (global destructor) 1;