projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Part Controller -part link in Verbrauchsbericht (?) aktualisiert
[kivitendo-erp.git]
/
SL
/
ReportGenerator.pm
diff --git
a/SL/ReportGenerator.pm
b/SL/ReportGenerator.pm
index
c5ef273
..
2e12a2a
100644
(file)
--- a/
SL/ReportGenerator.pm
+++ b/
SL/ReportGenerator.pm
@@
-47,6
+47,7
@@
sub new {
'escape_char' => '"',
'eol_style' => 'Unix',
'headers' => 1,
'escape_char' => '"',
'eol_style' => 'Unix',
'headers' => 1,
+ 'encoding' => 'UTF-8',
},
};
$self->{export} = {
},
};
$self->{export} = {
@@
-287,6
+288,7
@@
sub prepare_html_content {
'align' => $column->{align},
'link' => $column->{link},
'text' => $column->{text},
'align' => $column->{align},
'link' => $column->{link},
'text' => $column->{text},
+ 'raw_header_data' => $column->{raw_header_data},
'show_sort_indicator' => $name eq $opts->{sort_indicator_column},
'sort_indicator_direction' => $opts->{sort_indicator_direction},
};
'show_sort_indicator' => $name eq $opts->{sort_indicator_column},
'sort_indicator_direction' => $opts->{sort_indicator_direction},
};
@@
-702,10
+704,10
@@
sub _print_content {
}
sub _handle_quoting_and_encoding {
}
sub _handle_quoting_and_encoding {
- my ($self, $text, $do_unquote) = @_;
+ my ($self, $text, $do_unquote
, $encoding
) = @_;
$text = $main::locale->unquote_special_chars('HTML', $text) if $do_unquote;
$text = $main::locale->unquote_special_chars('HTML', $text) if $do_unquote;
- $text = Encode::encode('UTF-8', $text);
+ $text = Encode::encode(
$encoding ||
'UTF-8', $text);
return $text;
}
return $text;
}
@@
-744,7
+746,7
@@
sub _generate_csv_content {
if ($opts->{headers}) {
if (!$self->{custom_headers}) {
if ($opts->{headers}) {
if (!$self->{custom_headers}) {
- $csv->print($stdout, [ map { $self->_handle_quoting_and_encoding($self->{columns}->{$_}->{text}, 1) } @visible_columns ]);
+ $csv->print($stdout, [ map { $self->_handle_quoting_and_encoding($self->{columns}->{$_}->{text}, 1
, $opts->{encoding}
) } @visible_columns ]);
} else {
foreach my $row (@{ $self->{custom_headers} }) {
} else {
foreach my $row (@{ $self->{custom_headers} }) {
@@
-752,7
+754,7
@@
sub _generate_csv_content {
foreach my $col (@{ $row }) {
my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
foreach my $col (@{ $row }) {
my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
- push @{ $fields }, ($self->_handle_quoting_and_encoding($col->{text}, 1)) x $num_output;
+ push @{ $fields }, ($self->_handle_quoting_and_encoding($col->{text}, 1
, $opts->{encoding}
)) x $num_output;
}
$csv->print($stdout, $fields);
}
$csv->print($stdout, $fields);
@@
-774,7
+776,7
@@
sub _generate_csv_content {
my $num_output = ($row->{$col}{colspan} && ($row->{$col}->{colspan} > 1)) ? $row->{$col}->{colspan} : 1;
$skip_next = $num_output - 1;
my $num_output = ($row->{$col}{colspan} && ($row->{$col}->{colspan} > 1)) ? $row->{$col}->{colspan} : 1;
$skip_next = $num_output - 1;
- push @data, join($eol, map { s/\r?\n/$eol/g; $self->_handle_quoting_and_encoding($_, 0) } @{ $row->{$col}->{data} });
+ push @data, join($eol, map { s/\r?\n/$eol/g; $self->_handle_quoting_and_encoding($_, 0
, $opts->{encoding}
) } @{ $row->{$col}->{data} });
push @data, ('') x $skip_next if ($skip_next);
}
push @data, ('') x $skip_next if ($skip_next);
}
@@
-850,9
+852,10
@@
Adds data to the report. A given hash_ref is interpreted as a single line of
data, every array_ref as a collection of lines. Every line will be expected to
be in a key => value format. Note that the rows have to already have been
sorted.
data, every array_ref as a collection of lines. Every line will be expected to
be in a key => value format. Note that the rows have to already have been
sorted.
-The ReportGenerator is only able to sort pre-sorted data by column direction
-(ascending or descending), and provides links to sorting and a visual cue as to
-which column was sorted by.
+
+The ReportGenerator is only able to display pre-sorted data and to indicate by
+which column and in which direction the data has been sorted via visual clues
+in the column headers. It also provides links to invert the sort direction.
=item add_separator
=item add_separator
@@
-1024,6
+1027,10
@@
End of line style. Default is Unix.
Include headers? Default is yes.
Include headers? Default is yes.
+=item encoding
+
+Character encoding. Default is UTF-8.
+
=back
=head1 SEE ALO
=back
=head1 SEE ALO