Revision 85a71bad
Von Bernd Bleßmann vor fast 11 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
414 | 414 |
} |
415 | 415 |
|
416 | 416 |
sub save_report { |
417 |
my ($self, $report_id) = @_;
|
|
417 |
my ($self, %params) = @_;
|
|
418 | 418 |
|
419 | 419 |
if ($self->worker->is_multiplexed) { |
420 |
return $self->save_report_multi($report_id);
|
|
420 |
return $self->save_report_multi(%params);
|
|
421 | 421 |
} else { |
422 |
return $self->save_report_single($report_id);
|
|
422 |
return $self->save_report_single(%params);
|
|
423 | 423 |
} |
424 | 424 |
} |
425 | 425 |
|
426 | 426 |
sub save_report_single { |
427 |
my ($self, $report_id) = @_;
|
|
427 |
my ($self, %params) = @_;
|
|
428 | 428 |
|
429 | 429 |
$self->track_progress(phase => 'building report', progress => 0); |
430 | 430 |
|
... | ... | |
432 | 432 |
$clone_profile->save; # weird bug. if this isn't saved before adding it to the report, it will default back to the last profile. |
433 | 433 |
|
434 | 434 |
my $report = SL::DB::CsvImportReport->new( |
435 |
session_id => $::auth->create_or_refresh_session,
|
|
435 |
session_id => $params{session_id},
|
|
436 | 436 |
profile => $clone_profile, |
437 | 437 |
type => $self->type, |
438 | 438 |
file => '', |
... | ... | |
494 | 494 |
} |
495 | 495 |
|
496 | 496 |
sub save_report_multi { |
497 |
my ($self, $report_id) = @_;
|
|
497 |
my ($self, %params) = @_;
|
|
498 | 498 |
|
499 | 499 |
$self->track_progress(phase => 'building report', progress => 0); |
500 | 500 |
|
... | ... | |
502 | 502 |
$clone_profile->save; # weird bug. if this isn't saved before adding it to the report, it will default back to the last profile. |
503 | 503 |
|
504 | 504 |
my $report = SL::DB::CsvImportReport->new( |
505 |
session_id => $::auth->create_or_refresh_session,
|
|
505 |
session_id => $params{session_id},
|
|
506 | 506 |
profile => $clone_profile, |
507 | 507 |
type => $self->type, |
508 | 508 |
file => '', |
Auch abrufbar als: Unified diff
Beim CSV-Import die Session-Id der "auftraggebenden" Sitzung verwenden.
Damit kann der CSV-Import via Task-Server auch von Benutzern verwendet
werden, die den Task-Server nicht in ihrer Sitzung gestartet haben.
Es bleibt das Problem, dass der Import nicht ausgeführt werden kann,
wenn sie sich abmelden.
Behebt #2198.