% unless ( $opt{'js_only'} ) {
<% include( 'select.html',
'field' => $name.'_action',
'id' => $id.'_action',
'options' => \@actions,
'curr_value' => $action,
'labels' => { '' => 'Select Action' },
'onchange' => $name.'_changed',
'style' => 'vertical-align:top',
)
%>
% }
% unless ( $opt{'html_only'} || $opt{'js_only'} ) {
% }
<%once>
my @actions = (
'',
#generic http://www.communigate.com/CommunigatePro/Rules.html#Actions
'Reject',
'SendURL',
'Send IM',
'FingerNotify',
'Write To Log',
"Remember 'From' in",
#email http://www.communigate.com/CommunigatePro/QueueRules.html#Actions
'Stop Processing',
'Discard',
'Reject With',
'Mark',
'Add Header',
'Tag Subject',
'Store in',
'Redirect to',
'Forward to',
'Mirror to',
'Reply with',
'Reply to All with',
'React with',
'store Encrypted in',
'Copy attachments into',
'Execute',
'ExternalFilter',
'Accept Request',
);
my %noparam = ( map { $_=>1 } '', 'Stop Processing', 'Discard' );
%once>
<%init>
my %opt = @_;
my $name = $opt{'element_name'} || $opt{'field'} || 'ruleactionnum';
#my $id = $opt{'id'} || 'contactnum';
my $id = $opt{'id'} || $opt{'field'} || 'ruleactionnum';
my $curr_value = $opt{'curr_value'} || $opt{'value'};
my $cgp_rule_action;
if ( $curr_value ) {
$cgp_rule_action = qsearchs('cgp_rule_action',
{ 'ruleactionnum' => $curr_value } );
} else {
$cgp_rule_action = new FS::cgp_rule_action {};
}
my $action = scalar($cgi->param($name.'_action'))
|| $cgp_rule_action->action;
my $disabled = $noparam{$action} ? 'DISABLED' : '';
my $style = $disabled ? 'STYLE="visibility:hidden"' : '';
%init>