From 346be50ec6aac3cb58bc2a4c427777b414f07bd1 Mon Sep 17 00:00:00 2001 From: Bernd Blessmann Date: Fri, 22 Jun 2012 12:34:16 +0200 Subject: [PATCH] =?utf8?q?Benutzerdefinierte=20Variablen=20bei=20Ansprechp?= =?utf8?q?artnern=20=C3=BCber=20CSV=20importierbar=20machen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/CsvImport/Base.pm | 1 + SL/Controller/CsvImport/Contact.pm | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 6a66e8ca1..eda921f42 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -9,6 +9,7 @@ use SL::DB::Customer; use SL::DB::Language; use SL::DB::PaymentTerm; use SL::DB::Vendor; +use SL::DB::Contact; use parent qw(Rose::Object); diff --git a/SL/Controller/CsvImport/Contact.pm b/SL/Controller/CsvImport/Contact.pm index e5dadbbeb..5d0a1bea7 100644 --- a/SL/Controller/CsvImport/Contact.pm +++ b/SL/Controller/CsvImport/Contact.pm @@ -3,6 +3,8 @@ package SL::Controller::CsvImport::Contact; use strict; use SL::Helper::Csv; +use SL::DB::CustomVariable; +use SL::DB::CustomVariableConfig; use parent qw(SL::Controller::CsvImport::Base); @@ -16,6 +18,12 @@ sub init_class { $self->class('SL::DB::Contact'); } +sub init_all_cvar_configs { + my ($self) = @_; + + return SL::DB::Manager::CustomVariableConfig->get_all(where => [ module => 'Contacts' ]); +} + sub check_objects { my ($self) = @_; @@ -23,9 +31,11 @@ sub check_objects { $self->check_name($entry); $self->check_vc($entry, 'cp_cv_id'); $self->check_gender($entry); + $self->handle_cvars($entry); } $self->add_info_columns({ header => $::locale->text('Customer/Vendor'), method => 'vc_name' }); + $self->add_cvar_raw_data_columns; } sub check_name { @@ -87,6 +97,7 @@ sub setup_displayable_columns { my ($self) = @_; $self->SUPER::setup_displayable_columns; + $self->add_cvar_columns_to_displayable_columns; $self->add_displayable_columns({ name => 'cp_abteilung', description => $::locale->text('Department') }, { name => 'cp_birthday', description => $::locale->text('Birthday') }, -- 2.20.1