diff options
Diffstat (limited to 'rt/share/html/Search')
-rw-r--r-- | rt/share/html/Search/Build.html | 2 | ||||
-rw-r--r-- | rt/share/html/Search/Elements/PickCFs | 51 |
2 files changed, 37 insertions, 16 deletions
diff --git a/rt/share/html/Search/Build.html b/rt/share/html/Search/Build.html index c5067d5d1..f347acd79 100644 --- a/rt/share/html/Search/Build.html +++ b/rt/share/html/Search/Build.html @@ -188,7 +188,7 @@ my @new_values = (); # {{{ Try to find if we're adding a clause foreach my $arg ( keys %ARGS ) { - next unless $arg =~ m/^ValueOf(\w+|'CF.{.*?}')$/ + next unless $arg =~ m/^ValueOf(\w+|CF.{.*?})$/ && ( ref $ARGS{$arg} eq "ARRAY" ? grep $_ ne '', @{ $ARGS{$arg} } : $ARGS{$arg} ne '' ); diff --git a/rt/share/html/Search/Elements/PickCFs b/rt/share/html/Search/Elements/PickCFs index ba25cdeda..3f6d188b8 100644 --- a/rt/share/html/Search/Elements/PickCFs +++ b/rt/share/html/Search/Elements/PickCFs @@ -76,22 +76,43 @@ $m->callback( my @lines; while ( my $CustomField = $CustomFields->Next ) { my %line; - $line{'Name'} = "'CF.{" . $CustomField->Name . "}'"; + $line{'Name'} = "CF.{" . $CustomField->Name . "}"; $line{'Field'} = $CustomField->Name; - $line{'Op'} = { - Type => 'component', - Path => '/Elements/SelectCustomFieldOperator', - Arguments => { True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', - FalseVal => '!=', - }, - }; - $line{'Value'} = { - Type => 'component', - Path => '/Elements/SelectCustomFieldValue', - Arguments => { CustomField => $CustomField }, - }; + + # Op + if ($CustomField->Type eq 'Date') { + $line{'Op'} = { + Type => 'component', + Path => '/Elements/SelectDateRelation', + Arguments => {}, + }; + } else { + $line{'Op'} = { + Type => 'component', + Path => '/Elements/SelectCustomFieldOperator', + Arguments => { True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=', + }, + }; + } + + # Value + if ($CustomField->Type eq 'Date') { + $line{'Value'} = { + Type => 'component', + Path => '/Elements/SelectDate', + Arguments => {}, + }; + } else { + $line{'Value'} = { + Type => 'component', + Path => '/Elements/SelectCustomFieldValue', + Arguments => { CustomField => $CustomField }, + }; + } + push @lines, \%line; } |