[Koha-patches] [PATCH][HEAD](MT #2565) fix aqplan csv export, and turn off debug

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Wed May 26 16:06:45 CEST 2010


This fix the csv export that doesn't export correctly the budget name, it's empty column.
And it turn off some SQL debug that slow down the result of the page and the csv export.
---
 admin/aqplan.pl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/admin/aqplan.pl b/admin/aqplan.pl
index 594b3e6..0090208 100755
--- a/admin/aqplan.pl
+++ b/admin/aqplan.pl
@@ -51,7 +51,7 @@ my ( $template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user
         type            => "intranet",
         authnotrequired => 0,
         flagsrequired   => { acquisition => 'planning_manage' },
-        debug           => 1,
+        debug           => 0,
     }
 );
 
@@ -452,6 +452,8 @@ output_html_with_http_headers $input, $cookie, $template->output;
 sub _print_to_csv {
     my ( $header, $results ) = @_;
 
+    binmode STDOUT, ":utf8";
+
     my $csv = Text::CSV_XS->new(
         {   sep_char     => $del,
             always_quote => 'TRUE',
@@ -474,7 +476,8 @@ sub _print_to_csv {
     print "$str\n";
 
     foreach my $row (@$results) {
-        my @col = ( $row->{'budget_name'}, $row->{'budget_amount'} );
+        $row->{'budget_name_indent'} =~ s/ / /g;
+        my @col = ( $row->{'budget_name_indent'}, $row->{'budget_amount'} );
         my $l = $row->{'lines'};
         foreach my $line (@$l) {
             push @col, $line->{'estimated_amount'};
-- 
1.7.0.4



More information about the Koha-patches mailing list