From 15b4d5a3fdf1a6aafbd696f107a6dd7995edbc8c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 13 Jun 2007 11:26:01 +0000 Subject: [PATCH] =?utf8?q?Berichtsklasse:=201.=20Commit=20der=20vorher=20v?= =?utf8?q?ergessenen=20HTML-Templates=20f=C3=BCr=20die=20Berichte=20und=20?= =?utf8?q?die=20Exportoptionen.=202.=20HTML-Berichte:=20Zeilenumbr=C3=BCch?= =?utf8?q?e=20mit=20"\n"=20werden=20in=20"
"=20umgewandelt.=203.=20CSV-?= =?utf8?q?Export:=20Richtiger=20MIME-Type;=20Download=20der=20Datei=20forc?= =?utf8?q?ieren;=20Option=20f=C3=BCr=20die=20Spalten=C3=BCberschriften=20g?= =?utf8?q?efixt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/ReportGenerator.pm | 21 +++++- .../csv_export_options_de.html | 70 ++++++++++++++++++ .../csv_export_options_master.html | 70 ++++++++++++++++++ .../report_generator/html_report_de.html | 63 ++++++++++++++++ .../report_generator/html_report_master.html | 63 ++++++++++++++++ .../pdf_export_options_de.html | 73 +++++++++++++++++++ .../pdf_export_options_master.html | 73 +++++++++++++++++++ .../report_generator/pdf_report_de.html | 32 ++++++++ .../report_generator/pdf_report_master.html | 32 ++++++++ 9 files changed, 493 insertions(+), 4 deletions(-) create mode 100644 templates/webpages/report_generator/csv_export_options_de.html create mode 100644 templates/webpages/report_generator/csv_export_options_master.html create mode 100644 templates/webpages/report_generator/html_report_de.html create mode 100644 templates/webpages/report_generator/html_report_master.html create mode 100644 templates/webpages/report_generator/pdf_export_options_de.html create mode 100644 templates/webpages/report_generator/pdf_export_options_master.html create mode 100644 templates/webpages/report_generator/pdf_report_de.html create mode 100644 templates/webpages/report_generator/pdf_report_master.html 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=""> + + + +
+

+ + +

+
+ + + -- 2.20.1