Revision 067d87c8
Von Bernd Bleßmann vor fast 8 Jahren hinzugefügt
SL/BackgroundJob/CsvImport.pm | ||
---|---|---|
14 | 14 |
my $package = ref($self_or_class) || $self_or_class; |
15 | 15 |
$package =~ s/SL::BackgroundJob:://; |
16 | 16 |
|
17 |
my $profile = delete $params{profile} || SL::DB::CsvImportProfile->new; |
|
18 |
my $new_profile = $profile->clone_and_reset_deep; |
|
19 |
$new_profile->save; |
|
20 |
|
|
21 | 17 |
my %data = ( |
22 | 18 |
%params, |
23 |
profile_id => $new_profile->id, |
|
24 | 19 |
session_id => $::auth->get_session_id, |
25 | 20 |
); |
26 | 21 |
|
SL/Controller/CsvImport.pm | ||
---|---|---|
359 | 359 |
return $self->action_new; |
360 | 360 |
} |
361 | 361 |
|
362 |
# save tempory profile |
|
363 |
$self->profile($self->profile->clone_and_reset_deep)->save; |
|
364 |
|
|
362 | 365 |
$self->{background_job} = SL::BackgroundJob::CsvImport->create_job( |
363 | 366 |
file => $self->csv_file_name, |
364 |
profile => $self->profile,
|
|
367 |
profile_id => $self->profile->id,
|
|
365 | 368 |
type => $self->profile->type, |
366 | 369 |
test => $params{test}, |
367 | 370 |
employee_id => SL::DB::Manager::Employee->current->id, |
Auch abrufbar als: Unified diff
CsvImport: Controller erzeugt temporäres Profil, nicht der Hintergrund-Job.