Warenstammdaten: EAN: Leerzeichen trimmen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 25 Nov 2021 15:10:57 +0000 (16:10 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 25 Nov 2021 15:10:57 +0000 (16:10 +0100)
SL/Controller/Part.pm
templates/webpages/part/_basic_data.html

index 757f1ab..d2638fb 100644 (file)
@@ -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'),
index ba18da2..141f490 100644 (file)
@@ -33,7 +33,7 @@
              </tr>
              <tr>
                <th align="right">[% 'EAN-Code' | $T8 %]</th>
-               <td>[% L.input_tag("part.ean", SELF.part.ean, size=40) %]</td>
+               <td>[% L.input_tag("part.ean", SELF.part.ean, size=40, "data-validate"="trimmed_whitespaces") %]</td>
              </tr>
              <tr>
               [%- IF SELF.all_partsgroups.size %]