From 11fafb0ba321d8d345fd551c48b93aded6ac9b84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 15 Aug 2017 16:11:58 +0200 Subject: [PATCH] CsvImport: Im Report die Werte des gespeicherten Objekts speichern. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bei den Workern, die Objekte aktualisieren können, kann statt dem object das object_to_save gespeichert werden. Die Werte dieses Objekts sollten im Report angezeigt werden, auch wenn die eigentlich gleich sein müssten. Aber so können einem evtl. Fehler auffallen. --- SL/Controller/CsvImport.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index bb1e8d668..05043d9d3 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -604,8 +604,9 @@ sub save_report_single { $self->track_progress(progress => $row / @{ $self->data } * 100) if $row % 1000 == 0; my $data_row = $self->{data}[$row]; + my $object = $data_row->{object_to_save} || $data_row->{object}; do_statement($::form, $sth, $query, $report->id, $_, $row + 1, $data_row->{info_data}{ $info_methods[$_] }) for 0 .. $#info_methods; - do_statement($::form, $sth, $query, $report->id, $o1 + $_, $row + 1, $data_row->{object}->${ \ $methods[$_] }) for 0 .. $#methods; + do_statement($::form, $sth, $query, $report->id, $o1 + $_, $row + 1, $object->${ \ $methods[$_] }) for 0 .. $#methods; do_statement($::form, $sth, $query, $report->id, $o2 + $_, $row + 1, $data_row->{raw_data}{ $raw_methods[$_] }) for 0 .. $#raw_methods; do_statement($::form, $sth2, $query2, $report->id, $row + 1, 'information', $_) for @{ $data_row->{information} || [] }; @@ -694,8 +695,9 @@ sub save_report_multi { my $o1 = $off1->{$row_ident}; my $o2 = $off2->{$row_ident}; + my $object = $data_row->{object_to_save} || $data_row->{object}; do_statement($::form, $sth, $query, $report->id, $_, $row + $n_header_rows, $data_row->{info_data}{ $info_methods->{$row_ident}->[$_] }) for 0 .. $#{ $info_methods->{$row_ident} }; - do_statement($::form, $sth, $query, $report->id, $o1 + $_, $row + $n_header_rows, $data_row->{object}->${ \ $methods->{$row_ident}->[$_] }) for 0 .. $#{ $methods->{$row_ident} }; + do_statement($::form, $sth, $query, $report->id, $o1 + $_, $row + $n_header_rows, $object->${ \ $methods->{$row_ident}->[$_] }) for 0 .. $#{ $methods->{$row_ident} }; do_statement($::form, $sth, $query, $report->id, $o2 + $_, $row + $n_header_rows, $data_row->{raw_data}{ $raw_methods->{$row_ident}->[$_] }) for 0 .. $#{ $raw_methods->{$row_ident} }; do_statement($::form, $sth2, $query2, $report->id, $row + $n_header_rows, 'information', $_) for @{ $data_row->{information} || [] }; -- 2.20.1