1 % unless ( $opt{'js_only'} ) {
3 <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<%$curr_value%>">
5 <% include( 'select.html',
6 'field' => $name.'_action',
8 'options' => \@actions,
9 'curr_value' => scalar($cgi->param($name.'_action'))
10 || $cgp_rule_action->action,
11 'labels' => { '' => 'Select Action' },
12 'onchange' => $name.'_changed',
13 'style' => 'vertical-align:top',
17 <TEXTAREA NAME = "<% $name %>_params"
18 ID = "<% $id %>_params"
24 ><% scalar($cgi->param($name.'_params')) || $cgp_rule_action->params |h %></TEXTAREA>
27 % unless ( $opt{'html_only'} || $opt{'js_only'} ) {
28 <SCRIPT TYPE="text/javascript">
30 % unless ( $opt{'html_only'} ) {
32 function <% $name %>_changed(what) {
34 <% $opt{'onchange'} %>
36 var <% $name %>_value = what.options[what.selectedIndex].value;
38 var params_Element = what.form.<% $name %>_params;
40 // if bool, hide/disable _op and _params entirely
41 if ( <%$name%>_value == '' || <%$name%>_value == 'Stop Processing' || <%$name%>_value == 'Discard' ) {
42 params_Element.disabled = true;
43 params_Element.style.visibility = "hidden";
45 params_Element.disabled = false;
46 params_Element.style.visibility = "visible";
53 % unless ( $opt{'html_only'} || $opt{'js_only'} ) {
61 #generic http://www.communigate.com/CommunigatePro/Rules.html#Actions
69 #email http://www.communigate.com/CommunigatePro/QueueRules.html#Actions
84 'Copy attachments into',
90 my %noparam = ( map { $_=>1 } '', 'Stop Processing', 'Discard' );
97 my $name = $opt{'element_name'} || $opt{'field'} || 'ruleactionnum';
98 #my $id = $opt{'id'} || 'contactnum';
99 my $id = $opt{'id'} || $opt{'field'} || 'ruleactionnum';
101 my $curr_value = $opt{'curr_value'} || $opt{'value'};
105 $cgp_rule_action = qsearchs('cgp_rule_action',
106 { 'ruleactionnum' => $curr_value } );
108 $cgp_rule_action = new FS::cgp_rule_action {};
111 my $disabled = $noparam{$curr_value} ? 'DISABLED' : '';
112 my $style = $disabled ? 'STYLE="visibility:hidden"' : '';