View | Details | Raw Unified | Return to bug 10110
Collapse All | Expand All

(-)a/reports/guided_reports.pl (-6 / +10 lines)
Lines 18-24 Link Here
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
20
21
use CGI;
21
use CGI qw/-utf8/;
22
use Text::CSV;
22
use Text::CSV;
23
use URI::Escape;
23
use URI::Escape;
24
use C4::Reports::Guided;
24
use C4::Reports::Guided;
Lines 653-661 elsif ($phase eq 'Run this report'){ Link Here
653
            unless ($sth) {
653
            unless ($sth) {
654
                die "execute_query failed to return sth for report $report_id: $sql";
654
                die "execute_query failed to return sth for report $report_id: $sql";
655
            } else {
655
            } else {
656
                my $headref = $sth->{NAME} || [];
656
                my $headers= header_cell_loop($sth);
657
                my @headers = map { +{ cell => $_ } } @$headref;
657
                $template->param(header_row => $headers);
658
                $template->param(header_row => \@headers);
659
                while (my $row = $sth->fetchrow_arrayref()) {
658
                while (my $row = $sth->fetchrow_arrayref()) {
660
                    my @cells = map { +{ cell => $_ } } @$row;
659
                    my @cells = map { +{ cell => $_ } } @$row;
661
                    push @rows, { cells => \@cells };
660
                    push @rows, { cells => \@cells };
Lines 772-778 elsif ($phase eq 'Save Compound'){ Link Here
772
# pass $sth, get back an array of names for the column headers
771
# pass $sth, get back an array of names for the column headers
773
sub header_cell_values {
772
sub header_cell_values {
774
    my $sth = shift or return ();
773
    my $sth = shift or return ();
775
    return @{$sth->{NAME}};
774
    my @cols;
775
    foreach my $c (@{$sth->{NAME}}) {
776
        #FIXME apparently DBI still needs a utf8 fix for this?
777
        utf8::decode($c);
778
        push @cols, $c;
779
    }
780
    return @cols;
776
}
781
}
777
782
778
# pass $sth, get back a TMPL_LOOP-able set of names for the column headers
783
# pass $sth, get back a TMPL_LOOP-able set of names for the column headers
779
- 

Return to bug 10110