X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIC.pm;h=163f590696a14956833795e5032290e60c5dfb98;hb=313c7c4d7422770b3f28ce0b5d51f867472e1fce;hp=649ad2fd0659faecc0437c583d357c4ef78172ef;hpb=efb9a24f2252104ab4af5c25334119d7c5c70a8c;p=kivitendo-erp.git diff --git a/SL/IC.pm b/SL/IC.pm index 649ad2fd0..163f59069 100644 --- 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(); }