summaryrefslogtreecommitdiff
path: root/rt/share/html/Search
diff options
context:
space:
mode:
authorivan <ivan>2010-07-20 00:59:02 +0000
committerivan <ivan>2010-07-20 00:59:02 +0000
commit25591d52b441b5bfa34f0ffef1095098e1d2f1b2 (patch)
tree3f2881729adba24830ac73690523a1c5e64987b7 /rt/share/html/Search
parent1a62d4a284a58919716f076baa594f02dda2472d (diff)
RT custom fields patch, RT#8449
Diffstat (limited to 'rt/share/html/Search')
-rw-r--r--rt/share/html/Search/Build.html2
-rw-r--r--rt/share/html/Search/Elements/PickCFs51
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;
}