From 61b62e3c8c98aa1de965cc91927ad421afe1d192 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 25 Nov 2021 16:10:57 +0100 Subject: [PATCH] Warenstammdaten: EAN: Leerzeichen trimmen --- SL/Controller/Part.pm | 3 ++- templates/webpages/part/_basic_data.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 757f1abcd..d2638fb7e 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -709,7 +709,7 @@ sub add { sub _set_javascript { my ($self) = @_; - $::request->layout->use_javascript("${_}.js") for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart); + $::request->layout->use_javascript("${_}.js") for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart kivi.Validator); $::request->layout->add_javascripts_inline("\$(function(){kivi.PriceRule.load_price_rules_for_part(@{[ $self->part->id ]})});") if $self->part->id; } @@ -1335,6 +1335,7 @@ sub _setup_form_action_bar { t8('Save'), call => [ 'kivi.Part.save' ], disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef, + checks => ['kivi.validate_form'], ], action => [ t8('Use as new'), diff --git a/templates/webpages/part/_basic_data.html b/templates/webpages/part/_basic_data.html index ba18da266..141f49048 100644 --- a/templates/webpages/part/_basic_data.html +++ b/templates/webpages/part/_basic_data.html @@ -33,7 +33,7 @@ [% 'EAN-Code' | $T8 %] - [% L.input_tag("part.ean", SELF.part.ean, size=40) %] + [% L.input_tag("part.ean", SELF.part.ean, size=40, "data-validate"="trimmed_whitespaces") %] [%- IF SELF.all_partsgroups.size %] -- 2.20.1