[Rt-commit] r4323 - in rtir/branches/1.9-EXPERIMENTAL: .
html/RTIR/Search/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Sat Dec 17 21:14:58 EST 2005
Author: ruz
Date: Sat Dec 17 21:14:58 2005
New Revision: 4323
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs
Log:
r577 at cubic-pc: cubic | 2005-12-18 05:18:32 +0300
r569 at cubic-pc: cubic | 2005-12-14 22:49:01 +0300
* switch to ConditionRow component
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/PickCFs Sat Dec 17 21:14:58 2005
@@ -43,41 +43,43 @@
%# those contributions and any derivatives thereof.
%#
%# }}} END BPS TAGGED BLOCK
-% while ( my $CustomField = $CustomFields->Next ) {
-% my $label = $CustomField->Name;
-% next unless ($label =~ s/^_RTIR_//g);
-<tr><td class=label>
-
-% my $name;
-% if ($CustomField->QueueObj && $CustomField->QueueObj->id) {
-% $name = "'CF." . $CustomField->QueueObj->Name .
-% ".{" . $CustomField->Name . "}'";
-% } else {
-% $name = "'CF." . $CustomField->Name . "'";
-% }
-<% $label %>
-</td>
-<td>
-<& /Elements/SelectCustomFieldOperator, Name => $name . "Op",
- True => loc("is"),
- False => loc("isn't"),
- TrueVal=> '=', FalseVal => '!=' &>
-</td>
-<td>
-<& /Elements/SelectCustomFieldValue, Name => "ValueOf" . $name,
- CustomField => $CustomField,
- &>
-</td></tr>
+% foreach( @lines ) {
+<& /Search/Elements/ConditionRow, Condition => $_ &>
% }
-
<%INIT>
my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
my $QueueObj = RT::Queue->new($session{'CurrentUser'});
$QueueObj->Load($Queue);
$CustomFields->{"find_disabled_rows"} = 1;
-$CustomFields->LimitToQueue($QueueObj->Id);
-$CustomFields->LimitToGlobal();
+$CustomFields->LimitToQueue( $QueueObj->Id );
+$CustomFields->LimitToGlobal;
+
+my @lines;
+while ( my $CustomField = $CustomFields->Next ) {
+ my $label = $CustomField->Name;
+ next unless $label =~ s/^_RTIR_//;
+
+ my %line;
+ $line{'Name'} = "'CF.{" . $CustomField->Name . "}'";
+ $line{'Field'} = $label;
+ $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 },
+ };
+ push @lines, \%line;
+}
+
</%INIT>
<%ARGS>
More information about the Rt-commit
mailing list