projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Zelleninhalte, die nur "0" sind (also die Zahl "0"), wurden in PDF- und HTML-Ausgabe...
[kivitendo-erp.git]
/
SL
/
ReportGenerator.pm
diff --git
a/SL/ReportGenerator.pm
b/SL/ReportGenerator.pm
index
7421a78
..
588b824
100644
(file)
--- a/
SL/ReportGenerator.pm
+++ b/
SL/ReportGenerator.pm
@@
-44,7
+44,7
@@
sub new {
};
$self->{export} = {
'nextsub' => '',
};
$self->{export} = {
'nextsub' => '',
- 'variable_list' =>
''
,
+ 'variable_list' =>
[]
,
};
$self->{data_present} = 0;
};
$self->{data_present} = 0;
@@
-61,17
+61,18
@@
sub new {
sub _init_escaped_strings_map {
my $self = shift;
sub _init_escaped_strings_map {
my $self = shift;
- $self->{escaped_strings_map} =
-
(
'ä' => 'ä',
-
'ö' => 'ö',
-
'ü' => 'ü',
-
'Ä' => 'Ä',
-
'Ö' => 'Ö',
-
'Ü' => 'Ü',
-
'ß' => 'ß',
-
'>' => '>',
+ $self->{escaped_strings_map} =
{
+ 'ä' => 'ä',
+ 'ö' => 'ö',
+ 'ü' => 'ü',
+ 'Ä' => 'Ä',
+ 'Ö' => 'Ö',
+ 'Ü' => 'Ü',
+ 'ß' => 'ß',
+ '>' => '>',
'<' => '<',
'<' => '<',
- '"' => '"');
+ '"' => '"',
+ };
my $iconv = $main::locale->{iconv_iso8859};
my $iconv = $main::locale->{iconv_iso8859};
@@
-208,7
+209,7
@@
sub set_export_options {
$self->{export} = {
'nextsub' => shift,
$self->{export} = {
'nextsub' => shift,
- 'variable_list' =>
join(" ", @_)
,
+ 'variable_list' =>
[ @_ ]
,
};
}
};
}
@@
-342,7
+343,7
@@
sub prepare_html_content {
# will format the table cell (e.g. borders etc).
if (!scalar @{ $col->{CELL_ROWS} }) {
push @{ $col->{CELL_ROWS} }, { 'data' => ' ' };
# will format the table cell (e.g. borders etc).
if (!scalar @{ $col->{CELL_ROWS} }) {
push @{ $col->{CELL_ROWS} }, { 'data' => ' ' };
- } elsif ((1 == scalar @{ $col->{CELL_ROWS} }) &&
!$col->{CELL_ROWS}->[0]->{data}
) {
+ } elsif ((1 == scalar @{ $col->{CELL_ROWS} }) &&
(!defined $col->{CELL_ROWS}->[0]->{data} || ($col->{CELL_ROWS}->[0]->{data} eq ''))
) {
$col->{CELL_ROWS}->[0]->{data} = ' ';
}
}
$col->{CELL_ROWS}->[0]->{data} = ' ';
}
}
@@
-361,10
+362,7
@@
sub prepare_html_content {
}
}
}
}
- my @export_variables;
- foreach my $key (split m/ +/, $self->{export}->{variable_list}) {
- push @export_variables, { 'key' => $key, 'value' => $self->{form}->{$key} };
- }
+ my @export_variables = $self->{form}->flatten_variables(@{ $self->{export}->{variable_list} });
my $allow_pdf_export = $opts->{allow_pdf_export} && (-x $main::html2ps_bin) && (-x $main::ghostscript_bin);
my $allow_pdf_export = $opts->{allow_pdf_export} && (-x $main::html2ps_bin) && (-x $main::ghostscript_bin);
@@
-381,7
+379,7
@@
sub prepare_html_content {
'NUM_COLUMNS' => scalar @column_headers,
'ROWS' => \@rows,
'EXPORT_VARIABLES' => \@export_variables,
'NUM_COLUMNS' => scalar @column_headers,
'ROWS' => \@rows,
'EXPORT_VARIABLES' => \@export_variables,
- 'EXPORT_VARIABLE_LIST' =>
$self->{export}->{variable_list}
,
+ 'EXPORT_VARIABLE_LIST' =>
join(' ', @{ $self->{export}->{variable_list} })
,
'EXPORT_NEXTSUB' => $self->{export}->{nextsub},
'DATA_PRESENT' => $self->{data_present},
};
'EXPORT_NEXTSUB' => $self->{export}->{nextsub},
'DATA_PRESENT' => $self->{data_present},
};
@@
-521,7
+519,7
@@
sub unescape_string {
my $self = shift;
my $text = shift;
my $self = shift;
my $text = shift;
- foreach my $key (keys %{ $self->{escaped_stri
gn
s_map} }) {
+ foreach my $key (keys %{ $self->{escaped_stri
ng
s_map} }) {
$text =~ s/\Q$key\E/$self->{escaped_strings_map}->{$key}/g;
}
$text =~ s/\Q$key\E/$self->{escaped_strings_map}->{$key}/g;
}
@@
-555,7
+553,7
@@
sub generate_csv_content {
my @visible_columns = $self->get_visible_columns('CSV');
if ($opts->{headers}) {
my @visible_columns = $self->get_visible_columns('CSV');
if ($opts->{headers}) {
- $csv->print($stdout, [ map { $self->unescape_
for_csv
($self->{columns}->{$_}->{text}) } @visible_columns ]);
+ $csv->print($stdout, [ map { $self->unescape_
string
($self->{columns}->{$_}->{text}) } @visible_columns ]);
}
foreach my $row_set (@{ $self->{data} }) {
}
foreach my $row_set (@{ $self->{data} }) {