From: Moritz Bunkus Date: Wed, 10 Feb 2021 10:48:25 +0000 (+0100) Subject: GetModels Filtered: neuer Modifer »any« für logisches oder X-Git-Tag: kivitendo-mebil_0.1-0~9^2~482 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c46d944c0f688128ee33b2989260f3d9390c61d5;p=kivitendo-erp.git GetModels Filtered: neuer Modifer »any« für logisches oder Kann benutzt werden, um z.B. verschiedene Part-Klassifizierungs-IDs im Filter zu nutzen: --- diff --git a/SL/Controller/Helper/ParseFilter.pm b/SL/Controller/Helper/ParseFilter.pm index f91d671f3..0f7314179 100644 --- a/SL/Controller/Helper/ParseFilter.pm +++ b/SL/Controller/Helper/ParseFilter.pm @@ -125,7 +125,8 @@ sub _parse_filter { my ($type, $op) = $key =~ m{:(.+)::(.+)}; my $is_multi = $key =~ s/:multi//; - my @value_tokens = $is_multi ? parse_line('\s+', 0, $value) : ($value); + my $is_any = $key =~ s/:any//; + my @value_tokens = $is_multi || $is_any ? parse_line('\s+', 0, $value) : ($value); ($key, $method) = split m{::}, $key, 2; ($key, @filters) = split m{:}, $key; @@ -146,7 +147,7 @@ sub _parse_filter { next unless defined $key; - push @result, $is_multi ? (and => [ @args ]) : @args; + push @result, $is_multi ? (and => [ @args ]) : $is_any ? (or => [ @args ]) : @args; } return \@result; }