|
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 725-733
elsif ($phase eq 'Run this report'){
Link Here
|
| 725 |
unless ($sth) { |
725 |
unless ($sth) { |
| 726 |
die "execute_query failed to return sth for report $report_id: $sql"; |
726 |
die "execute_query failed to return sth for report $report_id: $sql"; |
| 727 |
} else { |
727 |
} else { |
| 728 |
my $headref = $sth->{NAME} || []; |
728 |
my $headers= header_cell_loop($sth); |
| 729 |
my @headers = map { +{ cell => $_ } } @$headref; |
729 |
$template->param(header_row => $headers); |
| 730 |
$template->param(header_row => \@headers); |
|
|
| 731 |
while (my $row = $sth->fetchrow_arrayref()) { |
730 |
while (my $row = $sth->fetchrow_arrayref()) { |
| 732 |
my @cells = map { +{ cell => $_ } } @$row; |
731 |
my @cells = map { +{ cell => $_ } } @$row; |
| 733 |
push @rows, { cells => \@cells }; |
732 |
push @rows, { cells => \@cells }; |
|
Lines 844-850
elsif ($phase eq 'Save Compound'){
Link Here
|
| 844 |
# pass $sth, get back an array of names for the column headers |
843 |
# pass $sth, get back an array of names for the column headers |
| 845 |
sub header_cell_values { |
844 |
sub header_cell_values { |
| 846 |
my $sth = shift or return (); |
845 |
my $sth = shift or return (); |
| 847 |
return @{$sth->{NAME}}; |
846 |
my @cols; |
|
|
847 |
foreach my $c (@{$sth->{NAME}}) { |
| 848 |
#FIXME apparently DBI still needs a utf8 fix for this? |
| 849 |
utf8::decode($c); |
| 850 |
push @cols, $c; |
| 851 |
} |
| 852 |
return @cols; |
| 848 |
} |
853 |
} |
| 849 |
|
854 |
|
| 850 |
# pass $sth, get back a TMPL_LOOP-able set of names for the column headers |
855 |
# pass $sth, get back a TMPL_LOOP-able set of names for the column headers |
| 851 |
- |
|
|