From: Moritz Bunkus Date: Wed, 16 Jan 2013 10:59:42 +0000 (+0100) Subject: CSV-Import Lieferadressen: Funktion gefixt X-Git-Tag: release-3.1.0beta1~690 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1a3920a1f7f2a75da8ae6db91f6c2a57e88b95ad;p=kivitendo-erp.git 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. --- diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 185c7adde..5f7e95e0e 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -122,6 +122,11 @@ sub add_cvar_raw_data_columns { map { $self->add_raw_data_columns($_) if exists $self->controller->data->[0]->{raw_data}->{$_} } @{ $self->cvar_columns }; } +sub init_all_cvar_configs { + # Must be overridden by derived specialized importer classes. + return []; +} + sub init_cvar_columns { my ($self) = @_; @@ -191,8 +196,6 @@ sub check_vc { sub handle_cvars { my ($self, $entry) = @_; - return unless $self->can('all_cvar_configs'); - my %type_to_column = ( text => 'text_value', textfield => 'text_value', select => 'text_value', @@ -231,11 +234,7 @@ sub init_profile { $profile{$col} = $name; } - if ($self->can('all_cvar_configs')) { - for (@{ $self->all_cvar_configs }) { - $profile{ 'cvar_' . $_->name } = ''; - } - } + $profile{ 'cvar_' . $_->name } = '' for @{ $self->all_cvar_configs }; \%profile; } @@ -266,8 +265,6 @@ sub setup_displayable_columns { sub add_cvar_columns_to_displayable_columns { my ($self) = @_; - return unless $self->can('all_cvar_configs'); - $self->add_displayable_columns(map { { name => 'cvar_' . $_->name, description => $::locale->text('#1 (custom variable)', $_->description) } } @{ $self->all_cvar_configs });