From 24e8b08430fe09e219b61b07d40bfc12c8f5ed1e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 13 Jun 2007 13:38:38 +0000 Subject: [PATCH] =?utf8?q?Reportgenerator:=20Man=20kann=20jetzt=20auch=20T?= =?utf8?q?rennzeilen=20einf=C3=BCgen,=20die=20in=20der=20HTML-Ausgabe=20al?= =?utf8?q?s=20horizontale=20Linie=20=C3=BCber=20die=20gesamte=20Tabellenbr?= =?utf8?q?eite=20realisiert=20sind.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/ReportGenerator.pm | 28 ++++++++++++++++++- .../report_generator/html_report_de.html | 26 +++++++++-------- .../report_generator/html_report_master.html | 26 +++++++++-------- 3 files changed, 57 insertions(+), 23 deletions(-) diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 37e6bede0..6a78c5370 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -86,17 +86,30 @@ sub set_sort_indicator { sub add_data { my $self = shift; + my $last_row_set; + while (my $arg = shift) { if ('ARRAY' eq ref $arg) { push @{ $self->{data} }, $arg; + $last_row_set = $arg; } elsif ('HASH' eq ref $arg) { - push @{ $self->{data} }, [ $arg ]; + my $row_set = [ $arg ]; + push @{ $self->{data} }, $row_set; + $last_row_set = $row_set; } else { $self->{form}->error('Incorrect usage -- expecting hash or array ref'); } } + + return $last_row_set; +} + +sub add_separator { + my $self = shift; + + push @{ $self->{data} }, { 'type' => 'separator' }; } sub clear_data { @@ -239,6 +252,18 @@ sub prepare_html_content { my @rows; foreach my $row_set (@{ $self->{data} }) { + if ('HASH' eq ref $row_set) { + my $row_data = { + 'IS_CONTROL' => 1, + 'IS_SEPARATOR' => $row_set->{type} eq 'separator', + 'NUM_COLUMNS' => scalar @visible_columns, + }; + + push @rows, $row_data; + + next; + } + $outer_idx++; foreach my $row (@{ $row_set }) { @@ -404,6 +429,7 @@ sub generate_csv_content { } foreach my $row_set (@{ $self->{data} }) { + next if ('ARRAY' ne ref $row_set); foreach my $row (@{ $row_set }) { $csv->print($stdout, [ map { $row->{$_}->{data} } @visible_columns ]); } diff --git a/templates/webpages/report_generator/html_report_de.html b/templates/webpages/report_generator/html_report_de.html index 899968e21..e60b0e77f 100644 --- a/templates/webpages/report_generator/html_report_de.html +++ b/templates/webpages/report_generator/html_report_de.html @@ -17,17 +17,21 @@ - - - align="" valign=""> - - - - - - - - + +
+ + + + align=""
valign="" class=""> + + + + + + +
+ +
diff --git a/templates/webpages/report_generator/html_report_master.html b/templates/webpages/report_generator/html_report_master.html index 4a8d8eb45..718cacaec 100644 --- a/templates/webpages/report_generator/html_report_master.html +++ b/templates/webpages/report_generator/html_report_master.html @@ -17,17 +17,21 @@ - - - align="" valign=""> - - - - - - - - + +
+ + + + align=""
valign="" class=""> + + + + + + +
+ +
-- 2.20.1