From: Sven Schöling Date: Wed, 14 Nov 2012 15:10:38 +0000 (+0100) Subject: Report in der richtigen Reihenfolge speichern und anzeigen. X-Git-Tag: release-3.1.0beta1~741 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=25ad1535122a8cd3bab24b0b71bd9bf887c40641;p=kivitendo-erp.git Report in der richtigen Reihenfolge speichern und anzeigen. --- diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 830d5ff77..cb54de9ad 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -282,15 +282,19 @@ sub save_report { my $sth = $dbh->prepare($query); my $sth2 = $dbh->prepare($query2); +# $::lxdebug->dump(0, "self", $self->info_headers); +# $::lxdebug->dump(0, "self", $self->headers); +# $::lxdebug->dump(0, "self", $self->raw_data_headers); + # save headers my @headers = ( - @{ $self->info_headers->{headers} || [] }, - @{ $self->headers->{headers} || [] }, - @{ $self->raw_data_headers->{headers} || [] }, + grep({ $self->info_headers->{used}->{$_} } @{ $self->info_headers->{headers} }), + grep({ $self->headers->{used}->{$_} } @{ $self->headers->{headers} }), + grep({ $self->raw_data_headers->{used}->{$_} } @{ $self->raw_data_headers->{headers} }), ); - my @info_methods = keys %{ $self->info_headers->{methods} || {} }; - my @methods = @{ $self->headers->{methods} || [] }; - my @raw_methods = keys %{ $self->raw_data_headers->{used} || {} }; + my @info_methods = grep { $self->info_headers->{used}->{$_} } @{ $self->info_headers->{headers} }; + my @methods = grep { $self->headers->{used}->{$_} } @{ $self->headers->{methods} }; + my @raw_methods = grep { $self->raw_data_headers->{used}->{$_} } @{ $self->raw_data_headers->{headers} }; $sth->execute($report->id, $_, 0, $headers[$_]) for 0 .. $#headers; diff --git a/templates/webpages/csv_import/report.html b/templates/webpages/csv_import/report.html index e6c34b004..353e87318 100644 --- a/templates/webpages/csv_import/report.html +++ b/templates/webpages/csv_import/report.html @@ -15,7 +15,7 @@ [%- ELSE %] [% csv_import_report_errors = SELF.report.folded_status.${loop.index}.errors %] - + [%- FOREACH value = row %] [%- value | html %] [%- END %]