}
_copy_custom_variables($self, $form, 'vc_cvar_', '', $cvar_validity{vc});
+ _copy_custom_variables($self->contact, $form, 'cp_cvar_', '') if $self->contact;
return $self;
}
sub _copy_custom_variables {
my ($src, $form, $prefix, $postfix, $cvar_validity) = @_;
- my $obj = (any { ref($src) eq $_ } qw(SL::DB::OrderItem SL::DB::DeliveryOrderItem SL::DB::InvoiceItem))
+ my $obj = (any { ref($src) eq $_ } qw(SL::DB::OrderItem SL::DB::DeliveryOrderItem SL::DB::InvoiceItem SL::DB::Contact))
? $src
: $src->customervendor;
translation_type => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'),
language_id => $form->{language_id},
allow_fallback => 1);
+ if ($form->{cp_id}) {
+ $custom_variables = CVar->get_custom_variables(dbh => $form->get_standard_dbh,
+ module => 'Contacts',
+ trans_id => $form->{cp_id});
+ $form->{"cp_cvar_$_->{name}"} = $_->{value} for @{ $custom_variables };
+ }
+
}
1;
'trans_id' => $form->{vendor_id});
map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables };
+ if ($form->{cp_id}) {
+ $custom_variables = CVar->get_custom_variables(dbh => $dbh,
+ module => 'Contacts',
+ trans_id => $form->{cp_id});
+ $form->{"cp_cvar_$_->{name}"} = $_->{value} for @{ $custom_variables };
+ }
+
$form->{cp_greeting} = GenericTranslations->get('dbh' => $dbh,
'translation_type' => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'),
'allow_fallback' => 1);
'trans_id' => $form->{customer_id});
map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables };
+ if ($form->{cp_id}) {
+ $custom_variables = CVar->get_custom_variables(dbh => $dbh,
+ module => 'Contacts',
+ trans_id => $form->{cp_id});
+ $form->{"cp_cvar_$_->{name}"} = $_->{value} for @{ $custom_variables };
+ }
+
$form->{cp_greeting} = GenericTranslations->get('dbh' => $dbh,
'translation_type' => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'),
'language_id' => $language_id,
<para>Die benutzerdefinierten Variablen der Lieferadressen stehen
unter einem ähnlichen Namensschema zur Verfügung. Hier lautet der
Präfix <varname>shiptocvar_</varname>.</para>
+
+ <para>Analog stehen die benutzerdefinierten Variablen für Ansprechpersonen mit dem Namenspräfix <varname>cp_cvar_</varname> zur Verfügung.</para>
</sect3>
</sect2>