Revision 1a3920a1
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Controller/CsvImport/Base.pm | ||
---|---|---|
122 | 122 |
map { $self->add_raw_data_columns($_) if exists $self->controller->data->[0]->{raw_data}->{$_} } @{ $self->cvar_columns }; |
123 | 123 |
} |
124 | 124 |
|
125 |
sub init_all_cvar_configs { |
|
126 |
# Must be overridden by derived specialized importer classes. |
|
127 |
return []; |
|
128 |
} |
|
129 |
|
|
125 | 130 |
sub init_cvar_columns { |
126 | 131 |
my ($self) = @_; |
127 | 132 |
|
... | ... | |
191 | 196 |
sub handle_cvars { |
192 | 197 |
my ($self, $entry) = @_; |
193 | 198 |
|
194 |
return unless $self->can('all_cvar_configs'); |
|
195 |
|
|
196 | 199 |
my %type_to_column = ( text => 'text_value', |
197 | 200 |
textfield => 'text_value', |
198 | 201 |
select => 'text_value', |
... | ... | |
231 | 234 |
$profile{$col} = $name; |
232 | 235 |
} |
233 | 236 |
|
234 |
if ($self->can('all_cvar_configs')) { |
|
235 |
for (@{ $self->all_cvar_configs }) { |
|
236 |
$profile{ 'cvar_' . $_->name } = ''; |
|
237 |
} |
|
238 |
} |
|
237 |
$profile{ 'cvar_' . $_->name } = '' for @{ $self->all_cvar_configs }; |
|
239 | 238 |
|
240 | 239 |
\%profile; |
241 | 240 |
} |
... | ... | |
266 | 265 |
sub add_cvar_columns_to_displayable_columns { |
267 | 266 |
my ($self) = @_; |
268 | 267 |
|
269 |
return unless $self->can('all_cvar_configs'); |
|
270 |
|
|
271 | 268 |
$self->add_displayable_columns(map { { name => 'cvar_' . $_->name, |
272 | 269 |
description => $::locale->text('#1 (custom variable)', $_->description) } } |
273 | 270 |
@{ $self->all_cvar_configs }); |
Auch abrufbar als: Unified diff
CSV-Import Lieferadressen: Funktion gefixt
Shipto hat keine custom variables. Die Base-Klasse hat sich aber
darauf verlassen, indem es 'all_cvar_configs' aufruft. Der Test mit
'$self->can("all_cvar_configs")' ist hier sinnfrei, weil
Rose::Object::MethodMaker nun mal genau diese Methoden anlegt.