Presenter: Neue Struktur in RecordLinks
[kivitendo-erp.git] / SL / IR.pm
index f3f1fd0..45cd7de 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -50,6 +50,7 @@ use SL::MoreCommon;
 use SL::DB::Default;
 use SL::DB::TaxZone;
 use SL::DB;
+use SL::Presenter::Part qw(type_abbreviation classification_abbreviation);
 use List::Util qw(min);
 
 use strict;
@@ -1309,8 +1310,8 @@ sub retrieve_item {
     if (($::form->{"partnumber_$i"} ne '') && ($ref->{ean} eq $::form->{"partnumber_$i"})) {
       push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean};
     }
-    $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}).
-                                 $::request->presenter->classification_abbreviation($ref->{classification_id});
+    $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) .
+                                 classification_abbreviation($ref->{classification_id});
 
     if (! $ref->{used_for_purchase} ) {
        $has_wrong_pclass = PCLASS_NOTFORPURCHASE;
@@ -1447,6 +1448,13 @@ sub vendor_details {
                                                     '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);