use SL::CVar;
use SL::DBUtils;
+use SL::HTML::Restrict;
use SL::TransNumber;
use strict;
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
$form->{lastcost},
$form->{weight},
$form->{unit},
- $form->{notes},
+ $restricter->process($form->{notes}),
$form->{formel},
$form->{rop},
conv_i($form->{warehouse_id}),
$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();
}
}
+ 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();
}