closes #2011
Wie Wulf vorgeschlagen hat, werden alle whitespaces beim Beginn eines Textblocks und beim Ende eines
Textblocks entfernt. Ferner werden mehrfach Wiederholungen von Leerzeichen innerhalb eines Blocks
auf nur ein Leerzeichen reduziert. Konfigurierbar (Standard an). OFFEN: Bei CSV-Import wird dies
noch nicht berücksichtigt
language_id => { type => 'integer' },
max_future_booking_interval => { type => 'integer', default => 360 },
mtime => { type => 'timestamp' },
language_id => { type => 'integer' },
max_future_booking_interval => { type => 'integer', default => 360 },
mtime => { type => 'timestamp' },
- # normalize_part_descriptions => { type => 'boolean', default => 'true' },
+ normalize_part_descriptions => { type => 'boolean', default => 'true' },
normalize_vc_names => { type => 'boolean', default => 'true' },
parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' },
parts_listing_image => { type => 'boolean', default => 'true' },
normalize_vc_names => { type => 'boolean', default => 'true' },
parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' },
parts_listing_image => { type => 'boolean', default => 'true' },
$subq_expense = "NULL";
}
$subq_expense = "NULL";
}
+ normalize_text_blocks();
+
$query =
qq|UPDATE parts SET
partnumber = ?,
$query =
qq|UPDATE parts SET
partnumber = ?,
$main::lxdebug->leave_sub();
}
$main::lxdebug->leave_sub();
}
+sub normalize_text_blocks {
+ $main::lxdebug->enter_sub();
+
+ my $self = shift;
+ my %params = @_;
+
+ my $form = $params{form} || $main::form;
+
+ # check if feature is enabled (select normalize_part_descriptions from defaults)
+ return unless ($::instance_conf->get_normalize_part_descriptions);
+
+ foreach (qw(description notes)) {
+ $form->{$_} =~ s/\s+$//s;
+ $form->{$_} =~ s/^\s+//s;
+ $form->{$_} =~ s/ {2,}/ /g;
+ }
+ $main::lxdebug->leave_sub();
+}
+
<td> [% L.input_tag('defaults.parts_image_css', SELF.defaults.parts_image_css, style=style) %]</td>
<td>[% LxERP.t8('Style the picture with the following CSS code') %]</td>
</tr>
<td> [% L.input_tag('defaults.parts_image_css', SELF.defaults.parts_image_css, style=style) %]</td>
<td>[% LxERP.t8('Style the picture with the following CSS code') %]</td>
</tr>
<td align="right">[% LxERP.t8('Normalize part description and part notes') %]</td>
<td> [% L.yes_no_tag('defaults.normalize_part_descriptions', SELF.defaults.normalize_part_descriptions) %]</td>
<td>[% LxERP.t8('Automatic deletion of leading, trailing and excessive (repetitive) spaces in part description and part notes. Affects also the CSV-Import.') %]</td>
</tr>
<td align="right">[% LxERP.t8('Normalize part description and part notes') %]</td>
<td> [% L.yes_no_tag('defaults.normalize_part_descriptions', SELF.defaults.normalize_part_descriptions) %]</td>
<td>[% LxERP.t8('Automatic deletion of leading, trailing and excessive (repetitive) spaces in part description and part notes. Affects also the CSV-Import.') %]</td>
</tr>