foreach my $row (@{ $row_set }) {
$inner_idx++;
+ my $output_columns = [ ];
+ my $skip_next = 0;
foreach my $col_name (@visible_columns) {
+ if ($skip_next) {
+ $skip_next--;
+ next;
+ }
+
my $col = $row->{$col_name};
$col->{CELL_ROWS} = [ ];
foreach my $i (0 .. scalar(@{ $col->{data} }) - 1) {
} elsif ((1 == scalar @{ $col->{CELL_ROWS} }) && (!defined $col->{CELL_ROWS}->[0]->{data} || ($col->{CELL_ROWS}->[0]->{data} eq ''))) {
$col->{CELL_ROWS}->[0]->{data} = ' ';
}
+
+ push @{ $output_columns }, $col;
+ $skip_next = $col->{colspan} ? $col->{colspan} - 1 : 0;
}
my $row_data = {
- 'COLUMNS' => [ map { $row->{$_} } @visible_columns ],
+ 'COLUMNS' => $output_columns,
'outer_idx' => $outer_idx,
'outer_idx_odd' => $outer_idx % 2,
'inner_idx' => $inner_idx,
$csv->print($stdout, [ map { $self->unescape_string($self->{columns}->{$_}->{text}) } @visible_columns ]);
} else {
- foreach my $custom_header_row (@{ $self->{custom_headers} }) {
- $csv->print($stdout, [ map { $self->unescape_string($_->{text}) } @{ $custom_header_row } ]);
+ foreach my $row (@{ $self->{custom_headers} }) {
+ my $fields = [ ];
+ my $skip_next = 0;
+
+ foreach my $col (@{ $row }) {
+ my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
+ push @{ $fields }, ($self->unescape_string($col->{text})) x $num_output;
+ }
+
+ $csv->print($stdout, $fields);
}
}
}
next if ('ARRAY' ne ref $row_set);
foreach my $row (@{ $row_set }) {
my @data;
+ my $skip_next = 0;
foreach my $col (@visible_columns) {
+ if ($skip_next) {
+ $skip_next--;
+ next;
+ }
+
+ my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
+ $skip_next = $num_output - 1;
+
push @data, join($eol, map { s/\r?\n/$eol/g; $_ } @{ $row->{$col}->{data} });
+ push @data, ('') x $skip_next if ($skip_next);
}
+
$csv->print($stdout, \@data);
}
}
[%- FOREACH row = HEADER_ROWS %]
<tr>
[% FOREACH col = row %]
- <th class="listheading">
+ <th class="listheading"
+ [%- IF col.align %] align="[% HTML.escape(col.align) %]"[% END -%]
+ [%- IF col.colspan && col.colspan > 1 %] colspan="[% HTML.escape(col.colspan) %]"[% END -%]
+ >
[%- IF col.link -%]<a href="[% col.link %]">[%- END -%]
[%- col.text -%]
[%- IF col.show_sort_indicator -%]<img border="0" src="image/[% IF col.sort_indicator_direction %]down[% ELSE %]up[% END %].png">[%- END -%]
[%- FOREACH col = row.COLUMNS %]
<td[% IF col.align %] align="[% col.align %]"[% END %]
[%- IF col.valign %] valign="[% col.valign %]"[%- END %]
+ [%- IF col.colspan && col.colspan > 1 %] colspan="[% HTML.escape(col.colspan) %]"[% END -%]
[%- SET tdclass = '' %]
[%- IF row.BORDER_TOP %][%- SET tdclass = "$tdclass top_border" %][%- END %]
[%- IF row.BORDER_BOTTOM %][%- SET tdclass = "$tdclass bottom_border" %][%- END %]
[%- FOREACH row = HEADER_ROWS %]
<tr>
[% FOREACH col = row %]
- <th class="listheading">
+ <th class="listheading"
+ [%- IF col.align %] align="[% HTML.escape(col.align) %]"[% END -%]
+ [%- IF col.colspan && col.colspan > 1 %] colspan="[% HTML.escape(col.colspan) %]"[% END -%]
+ >
[%- IF col.link -%]<a href="[% col.link %]">[%- END -%]
[%- col.text -%]
[%- IF col.show_sort_indicator -%]<img border="0" src="image/[% IF col.sort_indicator_direction %]down[% ELSE %]up[% END %].png">[%- END -%]
[%- FOREACH col = row.COLUMNS %]
<td[% IF col.align %] align="[% col.align %]"[% END %]
[%- IF col.valign %] valign="[% col.valign %]"[%- END %]
+ [%- IF col.colspan && col.colspan > 1 %] colspan="[% HTML.escape(col.colspan) %]"[% END -%]
[%- SET tdclass = '' %]
[%- IF row.BORDER_TOP %][%- SET tdclass = "$tdclass top_border" %][%- END %]
[%- IF row.BORDER_BOTTOM %][%- SET tdclass = "$tdclass bottom_border" %][%- END %]