From: Sven Schöling Date: Thu, 15 Nov 2012 17:42:40 +0000 (+0100) Subject: Bugs bei formatierten Methoden behoben X-Git-Tag: release-3.1.0beta1~729 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=670ca35b1a01456277369fd25a76087495a7cd08;p=kivitendo-erp.git Bugs bei formatierten Methoden behoben --- diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 29947a19b..9704566d6 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -342,14 +342,29 @@ sub save_report { my $sth2 = $dbh->prepare($query2); # save headers - my @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 (@headers, @info_methods, @raw_methods, @methods); + + for my $i (0 .. $#{ $self->info_headers->{headers} }) { + next unless $self->info_headers->{used}->{ $self->info_headers->{headers}->[$i] }; + push @headers, $self->info_headers->{headers}->[$i]; + push @info_methods, $self->info_headers->{methods}->[$i]; + } + for my $i (0 .. $#{ $self->headers->{headers} }) { + next unless $self->headers->{used}->{ $self->headers->{headers}->[$i] }; + push @headers, $self->headers->{headers}->[$i]; + push @methods, $self->headers->{methods}->[$i]; + } + for my $i (0 .. $#{ $self->raw_data_headers->{headers} }) { + next unless $self->raw_data_headers->{used}->{ $self->raw_data_headers->{headers}->[$i] }; + push @headers, $self->raw_data_headers->{headers}->[$i]; + push @raw_methods, $self->raw_data_headers->{headers}->[$i]; + } + + $::lxdebug->dump(0, "methods", + [ \@info_methods, + \@methods, + \@raw_methods ] ); - 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;