From c46d944c0f688128ee33b2989260f3d9390c61d5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 10 Feb 2021 11:48:25 +0100 Subject: [PATCH] =?utf8?q?GetModels=20Filtered:=20neuer=20Modifer=20=C2=BB?= =?utf8?q?any=C2=AB=20f=C3=BCr=20logisches=20oder?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Kann benutzt werden, um z.B. verschiedene Part-Klassifizierungs-IDs im Filter zu nutzen: --- SL/Controller/Helper/ParseFilter.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.20.1