communigate account rules: vacation & redirect all, RT#7514
[freeside.git] / httemplate / view / svc_acct / communigate.html
index 0f090fd..870744a 100644 (file)
                         value=>$svc_acct->cgp_sendmdnmode ) %>
 
 %# vacation message
-%#XXX finish me... do we need to search for specific rules
-%# (and hide them?)  need to see what CGP gives back after we've added a rule
   <% include('/elements/init_overlib.html') %>
 
   <TR>
     <TD ALIGN="right">Vacation message</TD>
     <TD BGCOLOR="#FFFFFF">
+      <% $vacation_rule ? 'Active' : '' %>
       <% include('/elements/popup_link.html',
                    'action' => $p.'edit/cgp_rule-vacation.html?'.
                                  'svcnum='. $svc_acct->svcnum,
-                   'label'  => '(add)', #XXX (edit)
+                   'label'  => $vacation_rule ? '(edit)' : '(add)',
                    'actionlabel' => 'Vacation message',
                    'width'  => 600,
                    'height' => 300,
   </TR>
 
 %# redirect all mail
-%#XXX finish me...
 
   <TR>
     <TD ALIGN="right">Redirect all mail</TD>
     <TD BGCOLOR="#FFFFFF">
+      <% $redirect_rule ? 'Active' : '' %>
       <% include('/elements/popup_link.html',
                    'action' => $p.'edit/cgp_rule-redirect_all.html?'.
                                  'svcnum='. $svc_acct->svcnum,
-                   'label'  => '(add)', #XXX (edit)
+                   'label'  => $redirect_rule ? '(edit)' : '(add)',
                    'actionlabel' => 'Redirect all mail',
                    'width' => 763,
                    #'height'
@@ -110,6 +109,16 @@ my $svc_acct = $opt{'svc_acct'};
 #my $part_svc = $opt{'part_svc'};
 
 my $rule_link = qq(<A HREF="${p}browse/cgp_rule.html?svcnum=).
-                      $svc_acct->svcnum. '">View/edit mail rules</A>';
+                      $svc_acct->svcnum. '">View/edit mail rules</A>'; #'dum vim
+
+my $vacation_rule = qsearchs('cgp_rule', { 'svcnum' => $svc_acct->svcnum,
+                                           'name'   => '#Vacation'
+                                         }
+                            );
+
+my $redirect_rule = qsearchs('cgp_rule', { 'svcnum' => $svc_acct->svcnum,
+                                           'name'   => '#Redirect'
+                                         }
+                            );
 
 </%init>