Revision 53fcb212
Von Jan Büren vor fast 11 Jahren hinzugefügt
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
55 | 55 |
language_id => { type => 'integer' }, |
56 | 56 |
max_future_booking_interval => { type => 'integer', default => 360 }, |
57 | 57 |
mtime => { type => 'timestamp' }, |
58 |
# normalize_part_descriptions => { type => 'boolean', default => 'true' },
|
|
58 |
normalize_part_descriptions => { type => 'boolean', default => 'true' }, |
|
59 | 59 |
normalize_vc_names => { type => 'boolean', default => 'true' }, |
60 | 60 |
parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' }, |
61 | 61 |
parts_listing_image => { type => 'boolean', default => 'true' }, |
SL/IC.pm | ||
---|---|---|
324 | 324 |
$subq_expense = "NULL"; |
325 | 325 |
} |
326 | 326 |
|
327 |
normalize_text_blocks(); |
|
328 |
|
|
327 | 329 |
$query = |
328 | 330 |
qq|UPDATE parts SET |
329 | 331 |
partnumber = ?, |
... | ... | |
1697 | 1699 |
$main::lxdebug->leave_sub(); |
1698 | 1700 |
} |
1699 | 1701 |
|
1702 |
sub normalize_text_blocks { |
|
1703 |
$main::lxdebug->enter_sub(); |
|
1704 |
|
|
1705 |
my $self = shift; |
|
1706 |
my %params = @_; |
|
1707 |
|
|
1708 |
my $form = $params{form} || $main::form; |
|
1709 |
|
|
1710 |
# check if feature is enabled (select normalize_part_descriptions from defaults) |
|
1711 |
return unless ($::instance_conf->get_normalize_part_descriptions); |
|
1712 |
|
|
1713 |
foreach (qw(description notes)) { |
|
1714 |
$form->{$_} =~ s/\s+$//s; |
|
1715 |
$form->{$_} =~ s/^\s+//s; |
|
1716 |
$form->{$_} =~ s/ {2,}/ /g; |
|
1717 |
} |
|
1718 |
$main::lxdebug->leave_sub(); |
|
1719 |
} |
|
1720 |
|
|
1700 | 1721 |
|
1701 | 1722 |
1; |
templates/webpages/client_config/_features.html | ||
---|---|---|
44 | 44 |
<td> [% L.input_tag('defaults.parts_image_css', SELF.defaults.parts_image_css, style=style) %]</td> |
45 | 45 |
<td>[% LxERP.t8('Style the picture with the following CSS code') %]</td> |
46 | 46 |
</tr> |
47 |
<!-- tr>
|
|
47 |
<tr> |
|
48 | 48 |
<td align="right">[% LxERP.t8('Normalize part description and part notes') %]</td> |
49 | 49 |
<td> [% L.yes_no_tag('defaults.normalize_part_descriptions', SELF.defaults.normalize_part_descriptions) %]</td> |
50 | 50 |
<td>[% LxERP.t8('Automatic deletion of leading, trailing and excessive (repetitive) spaces in part description and part notes. Affects also the CSV-Import.') %]</td> |
51 | 51 |
</tr> |
52 |
</tr -->
|
|
52 |
</tr> |
|
53 | 53 |
</table> |
54 | 54 |
</div> |
Auch abrufbar als: Unified diff
Zeilenumbrüche als letztes Zeichen bei part.description, part.notes beim Speichern in DB verhindern
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