Wenn GREEK CAPITAL LETTER DELTA im Text, dann auch utf8 flaggen.
[kivitendo-erp.git] / SL / IC.pm
index 649ad2f..163f590 100644 (file)
--- a/SL/IC.pm
+++ b/SL/IC.pm
@@ -40,6 +40,7 @@ use YAML;
 
 use SL::CVar;
 use SL::DBUtils;
+use SL::HTML::Restrict;
 use SL::TransNumber;
 
 use strict;
@@ -227,6 +228,7 @@ sub save {
   my @values;
   # connect to database, turn off AutoCommit
   my $dbh = $form->get_standard_dbh;
+  my $restricter = SL::HTML::Restrict->create;
 
   # save the part
   # make up a unique handle and store in partnumber field
@@ -371,7 +373,7 @@ sub save {
              $form->{lastcost},
              $form->{weight},
              $form->{unit},
-             $form->{notes},
+             $restricter->process($form->{notes}),
              $form->{formel},
              $form->{rop},
              conv_i($form->{warehouse_id}),
@@ -405,7 +407,7 @@ sub save {
     $sth   = $dbh->prepare($query);
 
     foreach my $translation (@translations) {
-      do_statement($form, $sth, $query, conv_i($form->{id}), conv_i($translation->{language_id}), $translation->{translation}, $translation->{longdescription});
+      do_statement($form, $sth, $query, conv_i($form->{id}), conv_i($translation->{language_id}), $translation->{translation}, $restricter->process($translation->{longdescription}));
     }
 
     $sth->finish();
@@ -1696,6 +1698,16 @@ sub prepare_parts_for_printing {
     }
   }
 
+  my $parts = SL::DB::Manager::Part->get_all(query => [ id => \@part_ids ]);
+  my %parts_by_id = map { $_->id => $_ } @$parts;
+
+  for my $i (1..$rowcount) {
+    my $id = $form->{"${prefix}${i}"};
+    next unless $id;
+
+    push @{ $form->{TEMPLATE_ARRAYS}{part_type} },  $parts_by_id{$id}->type;
+  }
+
   $main::lxdebug->leave_sub();
 }