1 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $opt{'svcnum'} %>">
2 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $opt{'pkgnum'} %>">
3 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $opt{'svcpart'} %>">
5 <SCRIPT TYPE="text/javascript">
6 function srcchanged(what) {
7 if ( what.options[what.selectedIndex].value == 0 ) {
8 what.form.src.disabled = false;
9 what.form.src.style.backgroundColor = "white";
11 what.form.src.disabled = true;
12 what.form.src.style.backgroundColor = "lightgrey";
15 function dstchanged(what) {
16 if ( what.options[what.selectedIndex].value == 0 ) {
17 what.form.dst.disabled = false;
18 what.form.dst.style.backgroundColor = "white";
20 what.form.dst.disabled = true;
21 what.form.dst.style.backgroundColor = "lightgrey";
26 <% ntable("#cccccc",2) %>
29 <TD ALIGN="right">Email to</TD>
31 % if ( $conf->exists('svc_forward-no_srcsvc') ) {
32 <INPUT NAME="srcsrc" TYPE="hidden" VALUE="0">
34 <SELECT NAME="srcsvc" SIZE=1 onChange="srcchanged(this)">
35 % foreach my $somesvc (keys %email) {
36 <OPTION VALUE="<% $somesvc %>"
37 <% $somesvc eq $opt{'srcsvc'} ? 'SELECTED' : '' %>
38 ><% $email{$somesvc} %></OPTION>
40 <OPTION VALUE="0" <% $opt{'src'} ? 'SELECTED' : '' %>
41 >(other email address)</OPTION>
45 % my $src_disabled = $opt{'src'}
46 % || $conf->exists('svc_forward-no_srcsvc')
50 VALUE = "<% $opt{'src'} %>"
51 <% $src_disabled ? '' : 'DISABLED STYLE="background-color: lightgrey"' %>
57 <TR><TD ALIGN="right">Forwards to</TD>
58 <TD><SELECT NAME="dstsvc" SIZE=1 onChange="dstchanged(this)">
59 % foreach my $somesvc (keys %email) {
61 <OPTION<% $somesvc eq $opt{'dstsvc'} ? " SELECTED" : "" %> VALUE="<% $somesvc %>"><% $email{$somesvc} %></OPTION>
64 <OPTION <% $opt{'dst'} ? 'SELECTED' : '' %> VALUE="0">(other email address)</OPTION>
66 <INPUT TYPE="text" NAME="dst" VALUE="<% $opt{'dst'} %>" <% ( $opt{'dst'} || !scalar(%email) ) ? '' : 'DISABLED STYLE="background-color: lightgrey"' %>>
72 # This is used directly by selfservice, only use what's passed
73 # Do not look up sensitive information here
77 my $conf = $opt{'conf'};
78 $conf ||= new FS::Conf;
81 %email = %{$opt{'email'}} if ref($opt{'email'}) eq 'HASH';