X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcgp_rule-vacation.html;h=8c288852ba0ac16ca2c5bb8d2a67cc25d6160163;hb=refs%2Fheads%2Fafc-realtime;hp=efdc5417e1fcc46e35816dd5c5afc7d8dcb8c07a;hpb=b9d57f0848ffe4d3cc97de49c9e7c55fecf6c26d;p=freeside.git diff --git a/httemplate/edit/cgp_rule-vacation.html b/httemplate/edit/cgp_rule-vacation.html index efdc5417e..8c288852b 100644 --- a/httemplate/edit/cgp_rule-vacation.html +++ b/httemplate/edit/cgp_rule-vacation.html @@ -1,35 +1,35 @@ <% include('/elements/header-popup.html', 'Vacation rule') %> +<% include('/elements/error.html') %> +
@@ -42,6 +42,23 @@ my %opt = @_; my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $opt{'svcnum'} } ) or die "unknown svcnum"; -#XXX look for existing vacation rule +#look for existing rule +my $cgp_rule = qsearchs('cgp_rule', { 'svcnum' => $svc_acct->svcnum, + 'name' => '#Vacation' + } + ); + +my( $curr_date, $reply_with ) = ( '', '' ); +if ( $cgp_rule ) { + $curr_date = qsearchs('cgp_rule_condition', { + 'rulenum' => $cgp_rule->rulenum, + 'conditionname' => 'Current Date', + 'op' => 'less than', + }); + $reply_with = qsearchs('cgp_rule_action', { + 'rulenum' => $cgp_rule->rulenum, + 'action' => 'Reply with', + }); +} %init>