diff options
Diffstat (limited to 'httemplate/edit/cgp_rule-redirect_all.html')
-rw-r--r-- | httemplate/edit/cgp_rule-redirect_all.html | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/httemplate/edit/cgp_rule-redirect_all.html b/httemplate/edit/cgp_rule-redirect_all.html deleted file mode 100644 index c8c9e01..0000000 --- a/httemplate/edit/cgp_rule-redirect_all.html +++ /dev/null @@ -1,89 +0,0 @@ -<% include('/elements/header-popup.html', 'Redirect all mail') %> - -<% include('/elements/error.html') %> - -<FORM NAME="RedirectAllForm" ACTION="process/cgp_rule-redirect_all.html" METHOD=POST> - -<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $opt{'svcnum'} %>"> - -<% ntable("#cccccc", 2) %> - -<TR> - <TD ALIGN="right">Redirect all mail to</TD> - <TD><textarea name="RedirectText" rows="5" cols="50"><% $mirror_or_redir ? $mirror_or_redir->params : '' %></textarea></TD> -</TR> - -<% include('/elements/tr-checkbox.html', - 'field' => 'RedirKeep', - 'label' => 'Keep a copy', - 'value' => 1, - 'curr_value' => ( $cgi->param('error') - ? scalar($cgi->param('RedirKeep')) - : ( ($redir_keep || !$cgp_rule) ? '' : 1 ) - ), - ) -%> - -<% include('/elements/tr-checkbox.html', - 'field' => 'RedirHuman', - 'label' => 'Do not redirect automatic messages', - 'value' => 1, - 'curr_value' => ( $cgi->param('error') - ? scalar($cgi->param('RedirHuman')) - : ( $redir_human ? 1 : '' ) - ), - ) -%> - -<% include('/elements/tr-checkbox.html', - 'field' => 'KeepToAndCc', - 'label' => 'Preserve To/Cc fields', - 'value' => 1, - 'curr_value' => ( $cgi->param('error') - ? scalar($cgi->param('KeepToAndCc')) - : ( $mirror_or_redir && - $mirror_or_redir->action eq 'Mirror To' ) - ), - ) -%> - -</TABLE> - -<BR> -<INPUT TYPE="submit" VALUE="Redirect all mail"> - -</FORM> - -</BODY> -</HTML> -<%init> - -my %opt = @_; - -my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $opt{'svcnum'} } ) - or die "unknown svcnum"; - -#look for existing rule -my $cgp_rule = qsearchs('cgp_rule', { 'svcnum' => $svc_acct->svcnum, - 'name' => '#Redirect' - } - ); - -my( $redir_human, $mirror_or_redir, $redir_keep ) = ( '', '', '' ); -if ( $cgp_rule ) { - $redir_human = qsearchs('cgp_rule_condition', { - 'rulenum' => $cgp_rule->rulenum, - 'conditionname' => 'Human Generated', - }); - $mirror_or_redir = qsearchs({ - 'table' => 'cgp_rule_action', - 'hashref' => { 'rulenum' => $cgp_rule->rulenum, }, - 'extra_sql' => " AND action IN ('Mirror To', 'Redirect To') ", - }); - $redir_keep = qsearchs('cgp_rule_action', { - 'rulenum' => $cgp_rule->rulenum, - 'action' => 'Discard', - }); -} - -</%init> |