diff options
author | ivan <ivan> | 2010-07-20 00:59:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-07-20 00:59:02 +0000 |
commit | 25591d52b441b5bfa34f0ffef1095098e1d2f1b2 (patch) | |
tree | 3f2881729adba24830ac73690523a1c5e64987b7 /rt/share/html/Search/Elements/PickCFs | |
parent | 1a62d4a284a58919716f076baa594f02dda2472d (diff) |
RT custom fields patch, RT#8449
Diffstat (limited to 'rt/share/html/Search/Elements/PickCFs')
-rw-r--r-- | rt/share/html/Search/Elements/PickCFs | 51 |
1 files changed, 36 insertions, 15 deletions
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; } |