8 |
8 |
use DateTime;
|
9 |
9 |
use SL::Helper::DateTime;
|
10 |
10 |
use List::MoreUtils qw(uniq);
|
|
11 |
use SL::Util qw(trim);
|
11 |
12 |
use SL::MoreCommon qw(listify);
|
12 |
13 |
use Data::Dumper;
|
13 |
14 |
use Text::ParseWords;
|
... | ... | |
24 |
25 |
date => sub { DateTime->from_lxoffice($_[0]) },
|
25 |
26 |
number => sub { $::form->parse_amount(\%::myconfig, $_[0]) },
|
26 |
27 |
percent => sub { $::form->parse_amount(\%::myconfig, $_[0]) / 100 },
|
27 |
|
head => sub { $_[0] . '%' },
|
28 |
|
tail => sub { '%' . $_[0] },
|
29 |
|
substr => sub { '%' . $_[0] . '%' },
|
|
28 |
head => sub { trim($_[0]) . '%' },
|
|
29 |
tail => sub { '%' . trim($_[0]) },
|
|
30 |
substr => sub { '%' . trim($_[0]) . '%' },
|
|
31 |
trim => sub { trim($_[0]) },
|
30 |
32 |
);
|
31 |
33 |
|
32 |
34 |
my %methods = (
|
... | ... | |
432 |
434 |
|
433 |
435 |
Parses the input string with C<< Form->parse_amount / 100 >>
|
434 |
436 |
|
|
437 |
=item trim
|
|
438 |
|
|
439 |
Removes whitespace characters (to be precice, characters with the \p{WSpace}
|
|
440 |
property from beginning and end of the value.
|
|
441 |
|
435 |
442 |
=item head
|
436 |
443 |
|
437 |
|
Adds "%" at the end of the string.
|
|
444 |
Adds "%" at the end of the string and applies C<trim>.
|
438 |
445 |
|
439 |
446 |
=item tail
|
440 |
447 |
|
441 |
|
Adds "%" at the end of the string.
|
|
448 |
Adds "%" at the end of the string and applies C<trim>.
|
442 |
449 |
|
443 |
450 |
=item substr
|
444 |
451 |
|
445 |
|
Adds "% .. %" around the search string.
|
446 |
|
|
447 |
|
=item eq_ignore_empty
|
448 |
|
|
449 |
|
Ignores this item if it's empty. Otherwise compares it with the
|
450 |
|
standard SQL C<=> operator.
|
|
452 |
Adds "% .. %" around the search string and applies C<trim>.
|
451 |
453 |
|
452 |
454 |
=back
|
453 |
455 |
|
... | ... | |
472 |
474 |
will match for C<NULL> and C<FALSE>; trueish values will only match
|
473 |
475 |
C<TRUE>.
|
474 |
476 |
|
|
477 |
=item eq_ignore_empty
|
|
478 |
|
|
479 |
Ignores this item if it's empty. Otherwise compares it with the
|
|
480 |
standard SQL C<=> operator.
|
|
481 |
|
475 |
482 |
=back
|
476 |
483 |
|
477 |
484 |
=head1 BUGS AND CAVEATS
|
ParseFilter: neuer Filter "trim"
Ausserdem autotrim bei substr, head und tail Filtern