communigate (phase 2): rules: start of adding conditions and actions to rule edit...
[freeside.git] / httemplate / elements / select-cgp_rule_condition.html
1 <% include( 'select.html',
2               %opt,
3               'options' => \@conditions, #reverse order if we ever need to spec
4               'labels'  => { '' => 'Select Condition' },
5           )
6 %>
7 <% include( 'select.html',
8               'name' => $opt{'field'}.'_op',
9               'id'   => ($opt{'field'}||$opt{'id'}).'_op',
10               'options' => \@myop,
11           )
12 %>
13 <% include( 'input-text.html',
14               'name' => $opt{'field'}.'_params',
15               #XXX curr value... anything else?
16           )
17 %>
18 <%init>
19
20 my %opt = @_;
21
22 my @conditions = (
23   '',
24   'From',
25   'Sender',
26   'To',
27   'Cc',
28   'Reply-To',
29   'Any To or Cc',
30   'Each To or Cc',
31   'Return-Path',
32   "'From' Name",
33   'Subject',
34   'Message-ID',
35   'Message Size',
36   'Human Generated',
37   'Header Field',
38   'Any Recipient',
39   'Each Recipient',
40   'Source',
41   'Security',
42   'Any Route',
43   'Each Route'
44 );
45
46 my %bool = (
47   'Human Generated' => 1,
48 );
49
50 my %number = (
51   'Message Size' => 1,
52 );
53
54 #XXX curr value -> hidden op / param / param selects depending
55
56 my @op = ( 'is', 'is not', 'in', 'not in' );
57 my @op_number = ( 'is', 'is_not', 'less than', 'greater than' );
58
59 my @myop = @op; #XXX  $number{$curr_value} ? @op_number : @op;
60 #XXX and a fancy onchange handler... yes.
61 #XXX (and for total hiding of the %bool one)
62
63 </%init>