X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FReportGenerator.pm;h=57a8c958c28fee74958d4fbfd20125a17477be4d;hb=b3673e83306a36c0582a08ea9eada300fe3987aa;hp=28399f794b70e534514d221ddb6429cd94ee864b;hpb=27bdd44b8c9c45f438138076938935df43977f86;p=kivitendo-erp.git diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 28399f794..57a8c958c 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -124,6 +124,13 @@ sub add_separator { push @{ $self->{data} }, { 'type' => 'separator' }; } +sub add_control { + my $self = shift; + my $data = shift; + + push @{ $self->{data} }, $data; +} + sub clear_data { my $self = shift; @@ -252,9 +259,11 @@ sub prepare_html_content { 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, + 'IS_CONTROL' => 1, + 'IS_SEPARATOR' => $row_set->{type} eq 'separator', + 'IS_COLSPAN_DATA' => $row_set->{type} eq 'colspan_data', + 'NUM_COLUMNS' => scalar @visible_columns, + 'data' => $row_set->{data}, }; push @rows, $row_data; @@ -270,7 +279,7 @@ sub prepare_html_content { foreach my $col_name (@visible_columns) { my $col = $row->{$col_name}; $col->{CELL_ROWS} = [ ]; - foreach my $i (0 .. scalar(@{ $col->{data} })) { + foreach my $i (0 .. scalar(@{ $col->{data} }) - 1) { push @{ $col->{CELL_ROWS} }, { 'data' => $self->html_format($col->{data}->[$i]), 'link' => $col->{link}->[$i], @@ -320,7 +329,7 @@ sub generate_html_content { my $self = shift; my $variables = $self->prepare_html_content(); - return $self->{form}->parse_html_template('report_generator/html_report', $variables); + return $self->{form}->parse_html_template2('report_generator/html_report', $variables); } sub verify_paper_size {