From 43c22d1ce7f8553219dc7347117bd9b54361b632 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 21 Jun 2007 13:33:18 +0000 Subject: [PATCH] =?utf8?q?ReportGenerator:=20Wenn=20keine=20Datens=C3=A4tz?= =?utf8?q?e=20hinzugef=C3=BCgt=20wurden,=20dann=20wird=20eine=20entspreche?= =?utf8?q?nde=20Meldung=20anstelle=20der=20Spalten=C3=BCberschriften=20aus?= =?utf8?q?gegeben.=20Die=20Export-Buttons=20werden=20in=20diesem=20Fall=20?= =?utf8?q?ebenfalls=20nicht=20angezeigt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/ReportGenerator.pm | 10 ++++++++-- locale/de/all | 1 + .../webpages/report_generator/html_report_de.html | 4 ++++ .../webpages/report_generator/html_report_master.html | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 57a8c958c..281000602 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -46,6 +46,8 @@ sub new { 'variable_list' => '', }; + $self->{data_present} = 0; + $self->set_options(@_) if (@_); return bless $self, $type; @@ -113,6 +115,8 @@ sub add_data { push @{ $self->{data} }, $row_set; $last_row_set = $row_set; + + $self->{data_present} = 1; } return $last_row_set; @@ -134,7 +138,8 @@ sub add_control { sub clear_data { my $self = shift; - $self->{data} = []; + $self->{data} = []; + $self->{data_present} = 0; } sub set_options { @@ -313,13 +318,14 @@ sub prepare_html_content { 'RAW_BOTTOM_INFO_TEXT' => $opts->{raw_bottom_info_text}, 'ALLOW_PDF_EXPORT' => $allow_pdf_export, 'ALLOW_CSV_EXPORT' => $opts->{allow_csv_export}, - 'SHOW_EXPORT_BUTTONS' => $allow_pdf_export || $opts->{allow_csv_export}, + 'SHOW_EXPORT_BUTTONS' => ($allow_pdf_export || $opts->{allow_csv_export}) && $self->{data_present}, 'COLUMN_HEADERS' => \@column_headers, 'NUM_COLUMNS' => scalar @column_headers, 'ROWS' => \@rows, 'EXPORT_VARIABLES' => \@export_variables, 'EXPORT_VARIABLE_LIST' => $self->{export}->{variable_list}, 'EXPORT_NEXTSUB' => $self->{export}->{nextsub}, + 'DATA_PRESENT' => $self->{data_present}, }; return $variables; diff --git a/locale/de/all b/locale/de/all index 62d9d4cc7..b4aa531a3 100644 --- a/locale/de/all +++ b/locale/de/all @@ -743,6 +743,7 @@ aktualisieren wollen?', 'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Händler gefunden', 'No backup file has been uploaded.' => 'Es wurde keine Sicherungsdatei hochgeladen.', 'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.', + 'No data was found.' => 'Es wurden keine Daten gefunden.', 'No databases have been found on this server.' => 'Auf diesem Server wurden keine Datenbanken gefunden.', 'No datasets have been selected.' => 'Es wurden keine Datenbanken ausgewählt.', 'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.', diff --git a/templates/webpages/report_generator/html_report_de.html b/templates/webpages/report_generator/html_report_de.html index ede17f975..9ed2bf02c 100644 --- a/templates/webpages/report_generator/html_report_de.html +++ b/templates/webpages/report_generator/html_report_de.html @@ -22,6 +22,7 @@ [% RAW_TOP_INFO_TEXT %] + [% IF DATA_PRESENT %]

@@ -45,6 +46,9 @@

+ [% ELSE %] +

Es wurden keine Daten gefunden.

+ [% END %] [% RAW_BOTTOM_INFO_TEXT %] diff --git a/templates/webpages/report_generator/html_report_master.html b/templates/webpages/report_generator/html_report_master.html index ede17f975..36836d19a 100644 --- a/templates/webpages/report_generator/html_report_master.html +++ b/templates/webpages/report_generator/html_report_master.html @@ -22,6 +22,7 @@ [% RAW_TOP_INFO_TEXT %] + [% IF DATA_PRESENT %]

@@ -45,6 +46,9 @@

+ [% ELSE %] +

No data was found.

+ [% END %] [% RAW_BOTTOM_INFO_TEXT %] -- 2.20.1