X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FBackgroundJob%2FCsvImport.pm;h=1798d67ba390b6ed8e61300a4ab5ceb793f5f4ec;hb=e1596b6b1096b5a19d629ff1970e65e925fa29b9;hp=ae71123849ad4515a75cd73b060f11d5479dfde3;hpb=d344cfd7fecb086e2e99a7cfa3d7107efc904b88;p=kivitendo-erp.git diff --git a/SL/BackgroundJob/CsvImport.pm b/SL/BackgroundJob/CsvImport.pm index ae7112384..1798d67ba 100644 --- a/SL/BackgroundJob/CsvImport.pm +++ b/SL/BackgroundJob/CsvImport.pm @@ -61,6 +61,7 @@ sub do_import { $c->profile($self->profile); $c->type($job->data_as_hash->{type}); + $c->{employee_id} = $job->data_as_hash->{employee_id}; my $test = $job->data_as_hash->{test}; @@ -81,20 +82,25 @@ sub do_import { ); $c->add_progress_tracker($self); + my $session_id = $job->data_as_hash->{session_id}; - $c->test_and_import(test => $test, session_id => $job->data_as_hash->{session_id}); - + $c->test_and_import(test => $test, session_id => $session_id); + my $result; if ($c->errors) { $job->set_data( errors => $c->errors, )->save; + $result = $::locale->text('Import finished with errors.'); } else { - my $report_id = $c->save_report; + my $report_id = $c->save_report(session_id => $session_id); $job->set_data(report_id => $report_id)->save; $c->track_progress(finished => 1); + $result = $::locale->text('Import finished without errors.'); } + + return $result; } sub track_progress {