Revision a0d9f09a
Von Sven Schöling vor fast 8 Jahren hinzugefügt
SL/Controller/CsvImport/Base.pm | ||
---|---|---|
34 | 34 |
my $profile = $self->profile; |
35 | 35 |
$self->csv(SL::Helper::Csv->new(file => $self->file->file_name, |
36 | 36 |
encoding => $self->controller->profile->get('charset'), |
37 |
profile => [{ profile => $profile, class => $self->class }], |
|
37 |
profile => [{ profile => $profile, class => $self->class, mapping => $self->controller->mappings_for_profile }],
|
|
38 | 38 |
ignore_unknown_columns => 1, |
39 | 39 |
strict_profile => 1, |
40 | 40 |
case_insensitive_header => 1, |
... | ... | |
54 | 54 |
|
55 | 55 |
return if ( !$self->csv->header || $self->csv->errors ); |
56 | 56 |
|
57 |
my $headers = { headers => [ grep { $profile->{$_} } @{ $self->csv->header } ] };
|
|
58 |
$headers->{methods} = [ map { $profile->{$_} } @{ $headers->{headers} } ];
|
|
59 |
$headers->{used} = { map { ($_ => 1) } @{ $headers->{headers} } };
|
|
57 |
my $headers = { headers => [ map {; $_->{key} } @{ $self->csv->specs->[0] } ] };
|
|
58 |
$headers->{methods} = [ map { $_->{path} } @{ $self->csv->specs->[0] } ];
|
|
59 |
$headers->{used} = { map { ($_ => 1) } @{ $headers->{headers} } }; |
|
60 | 60 |
$self->controller->headers($headers); |
61 | 61 |
$self->controller->raw_data_headers({ used => { }, headers => [ ] }); |
62 | 62 |
$self->controller->info_headers({ used => { }, headers => [ ] }); |
Auch abrufbar als: Unified diff
CsvImport: Spaltenzuordnung für non multiplexed