From: Moritz Bunkus Date: Wed, 13 Jun 2007 11:26:01 +0000 (+0000) Subject: Berichtsklasse: X-Git-Tag: release-2.4.3^2~150 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=15b4d5a3fdf1a6aafbd696f107a6dd7995edbc8c;p=kivitendo-erp.git Berichtsklasse: 1. Commit der vorher vergessenen HTML-Templates für die Berichte und die Exportoptionen. 2. HTML-Berichte: Zeilenumbrüche mit "\n" werden in "
" umgewandelt. 3. CSV-Export: Richtiger MIME-Type; Download der Datei forcieren; Option für die Spaltenüberschriften gefixt. --- diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 35a3d83e8..37e6bede0 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -181,8 +181,8 @@ sub generate_with_headers { print $self->generate_html_content(); } elsif ($format eq 'csv') { - print qq|content-type: text/plain\n\n|; -# print qq|content-disposition: attachment; filename=${filename}.csv\n\n|; + print qq|content-type: text/csv\n|; + print qq|content-disposition: attachment; filename=${filename}.csv\n\n|; $self->generate_csv_content(); } elsif ($format eq 'pdf') { @@ -202,6 +202,17 @@ sub get_visible_columns { return grep { my $c = $self->{columns}->{$_}; $c && $c->{visible} && (($c->{visible} == 1) || ($c->{visible} =~ /${format}/i)) } @{ $self->{column_order} }; } +sub html_format { + my $self = shift; + my $value = shift; + + $value = $self->{form}->quote_html($value); + $value =~ s/\r//g; + $value =~ s/\n/
/g; + + return $value; +} + sub prepare_html_content { my $self = shift; @@ -233,6 +244,8 @@ sub prepare_html_content { foreach my $row (@{ $row_set }) { $inner_idx++; + map { $row->{$_}->{data} = $self->html_format($row->{$_}->{data}) } @visible_columns; + my $row_data = { 'COLUMNS' => [ map { $row->{$_} } @visible_columns ], 'outer_idx' => $outer_idx, @@ -253,9 +266,9 @@ sub prepare_html_content { my $variables = { 'TITLE' => $opts->{title}, - 'TOP_INFO_TEXT' => $opts->{top_info_text}, + 'TOP_INFO_TEXT' => $self->html_format($opts->{top_info_text}), 'RAW_TOP_INFO_TEXT' => $opts->{raw_top_info_text}, - 'BOTTOM_INFO_TEXT' => $opts->{bottom_info_text}, + 'BOTTOM_INFO_TEXT' => $self->html_format($opts->{bottom_info_text}), 'RAW_BOTTOM_INFO_TEXT' => $opts->{raw_bottom_info_text}, 'ALLOW_PDF_EXPORT' => $allow_pdf_export, 'ALLOW_CSV_EXPORT' => $opts->{allow_csv_export}, diff --git a/templates/webpages/report_generator/csv_export_options_de.html b/templates/webpages/report_generator/csv_export_options_de.html new file mode 100644 index 000000000..d76bb032c --- /dev/null +++ b/templates/webpages/report_generator/csv_export_options_de.html @@ -0,0 +1,70 @@ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Anführungszeichen + +
Escape-Zeichen + +
Feldtrennzeichen + +
Zeilenumbrüche + +
Optionen: + + Spaltenüberschriften erzeugen +
+ +

+ +
+ + diff --git a/templates/webpages/report_generator/csv_export_options_master.html b/templates/webpages/report_generator/csv_export_options_master.html new file mode 100644 index 000000000..927ef6f3b --- /dev/null +++ b/templates/webpages/report_generator/csv_export_options_master.html @@ -0,0 +1,70 @@ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Quote chararacter + +
Escape character + +
Separator chararacter + +
Line endings + +
Options: + + Include column headings +
+ +

+ +
+ + diff --git a/templates/webpages/report_generator/html_report_de.html b/templates/webpages/report_generator/html_report_de.html new file mode 100644 index 000000000..899968e21 --- /dev/null +++ b/templates/webpages/report_generator/html_report_de.html @@ -0,0 +1,63 @@ + + +
+ + +

+
+ + + +

+ + + + + + + + + + + align="" valign=""> + + + + + + + + + + + + +

+

+ + + + +

+
+ + +
+ + + + + + + + + +

+ Listenexport
+ + +

+
+
+ + diff --git a/templates/webpages/report_generator/html_report_master.html b/templates/webpages/report_generator/html_report_master.html new file mode 100644 index 000000000..4a8d8eb45 --- /dev/null +++ b/templates/webpages/report_generator/html_report_master.html @@ -0,0 +1,63 @@ + + +
+ + +

+
+ + + +

+ + + + + + + + + + + align="" valign=""> + + + + + + + + + + + + +

+

+ + + + +

+
+ + +
+ + + + + + + + + +

+ List export
+ + +

+
+
+ + diff --git a/templates/webpages/report_generator/pdf_export_options_de.html b/templates/webpages/report_generator/pdf_export_options_de.html new file mode 100644 index 000000000..de8e33fda --- /dev/null +++ b/templates/webpages/report_generator/pdf_export_options_de.html @@ -0,0 +1,73 @@ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Seitenformat + + +
Schriftgrößept
Seitenränder:
Obencm
Linkscm
Untencm
Rechtscm
Optionen: + + Seiten nummerieren +
+ +

+ +
+ + diff --git a/templates/webpages/report_generator/pdf_export_options_master.html b/templates/webpages/report_generator/pdf_export_options_master.html new file mode 100644 index 000000000..75bfc5671 --- /dev/null +++ b/templates/webpages/report_generator/pdf_export_options_master.html @@ -0,0 +1,73 @@ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Orientation + + +
Font sizept
Margins:
Topcm
Leftcm
Bottomcm
Rightcm
Options: + + Number pages +
+ +

+ +
+ + diff --git a/templates/webpages/report_generator/pdf_report_de.html b/templates/webpages/report_generator/pdf_report_de.html new file mode 100644 index 000000000..9e32016ae --- /dev/null +++ b/templates/webpages/report_generator/pdf_report_de.html @@ -0,0 +1,32 @@ + + + +
+ + +

+
+ +

+ + + + + + + + + + align="" valign=""> + + + +
+

+ + +

+
+ + + diff --git a/templates/webpages/report_generator/pdf_report_master.html b/templates/webpages/report_generator/pdf_report_master.html new file mode 100644 index 000000000..9e32016ae --- /dev/null +++ b/templates/webpages/report_generator/pdf_report_master.html @@ -0,0 +1,32 @@ + + + +
+ + +

+
+ +

+ + + + + + + + + + align="" valign=""> + + + +
+

+ + +

+
+ + +