summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/REAL_cust_pkg.cgi19
-rwxr-xr-xhttemplate/edit/cust_main.cgi6
-rwxr-xr-xhttemplate/edit/part_bill_event.cgi24
-rw-r--r--httemplate/edit/part_export.cgi30
-rwxr-xr-xhttemplate/edit/part_pkg.cgi17
-rwxr-xr-xhttemplate/edit/part_svc.cgi6
-rwxr-xr-xhttemplate/edit/process/REAL_cust_pkg.cgi1
-rwxr-xr-xhttemplate/edit/process/part_bill_event.cgi2
-rw-r--r--httemplate/edit/process/part_export.cgi6
-rw-r--r--httemplate/edit/process/quick-charge.cgi32
-rw-r--r--httemplate/edit/process/quick-cust_pkg.cgi4
-rw-r--r--httemplate/edit/process/svc_www.cgi4
-rwxr-xr-xhttemplate/edit/svc_acct.cgi12
-rwxr-xr-xhttemplate/edit/svc_forward.cgi133
-rw-r--r--httemplate/edit/svc_www.cgi3
15 files changed, 170 insertions, 129 deletions
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi
index 580313e88..0d2f1c238 100755
--- a/httemplate/edit/REAL_cust_pkg.cgi
+++ b/httemplate/edit/REAL_cust_pkg.cgi
@@ -1,6 +1,6 @@
<!-- mason kludge -->
<%
-# <!-- $Id: REAL_cust_pkg.cgi,v 1.3 2002-04-23 07:32:49 ivan Exp $ -->
+# <!-- $Id: REAL_cust_pkg.cgi,v 1.4 2002-07-08 13:07:40 ivan Exp $ -->
my $error ='';
my $pkgnum = '';
@@ -45,7 +45,7 @@ print '<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">',
print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!
if $error;
-print &ntable("#cccccc"), '<TR><TD>', &ntable("#cccccc",2),
+print ntable("#cccccc",2),
'<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
$pkgnum, '</TD></TR>',
'<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
@@ -66,16 +66,23 @@ print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
time2str("%D",$susp), '</TD></TR>'
if $susp;
-print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
- time2str("%D",$expire), '</TD></TR>'
- if $expire;
+#print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
+# time2str("%D",$expire), '</TD></TR>'
+# if $expire;
+print '<TR><TD ALIGN="right">Expiration date'.
+ '</TD><TD>',
+ '<INPUT TYPE="text" NAME="expire" SIZE=32 VALUE="',
+ ( $expire ? time2str("%c %z (%Z)",$expire) : "" ), '">'.
+ '<BR><FONT SIZE=-1>(will <b>cancel</b> this package'.
+ ' when the date is reached)</FONT>'.
+ '</TD></TR>';
print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
time2str("%D",$cancel), '</TD></TR>'
if $cancel;
%>
-</TABLE></TD></TR></TABLE>
+</TABLE>
<BR><INPUT TYPE="submit" VALUE="Apply Changes">
</FORM>
</BODY>
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index cf8de2f13..3a5df086f 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -73,7 +73,7 @@ my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
my @agents = qsearch( 'agent', {} );
#die "No agents created!" unless @agents;
-die "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
+eidiot "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first
if ( scalar(@agents) == 1 ) {
print qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$agentnum">!;
@@ -99,7 +99,7 @@ if ( $custnum && ! $conf->exists('editreferrals') ) {
} else {
my(@referrals) = qsearch('part_referral',{});
if ( scalar(@referrals) == 0 ) {
- die "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources.";
+ eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources.";
} elsif ( scalar(@referrals) == 1 ) {
$refnum ||= $referrals[0]->refnum;
print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
@@ -231,7 +231,7 @@ END
print '<BR>Service address ',
'(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)"';
- unless ( $cust_main->ship_last ) {
+ unless ( $cust_main->ship_last && $cgi->param('same') ne 'Y' ) {
print ' CHECKED';
foreach (
qw( last first company address1 address2 city county state zip country
diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi
index 324daeb90..a10a186a9 100755
--- a/httemplate/edit/part_bill_event.cgi
+++ b/httemplate/edit/part_bill_event.cgi
@@ -134,6 +134,30 @@ tie my %events, 'Tie::IxHash',
'weight' => 50,
},
+ 'send_csv_ftp' => {
+ 'name' => 'Upload CSV invoice data to an FTP server',
+ 'code' => '$cust_bill->send_csv( protocol => \'ftp\',
+ server => \'%%%ftpserver%%%\',
+ username => \'%%%ftpusername%%%\',
+ password => \'%%%ftppassword%%%\',
+ dir => \'%%%ftpdir%%%\' );',
+ 'html' =>
+ '<TABLE BORDER=0><TR><TD ALIGN="right">FTP server: </TD>'.
+ '<TD><INPUT TYPE="text" NAME="ftpserver" VALUE="%%%ftpserver%%%">'.
+ '</TD></TR>'.
+ '<TR><TD ALIGN="right">FTP username: </TD><TD>'.
+ '<INPUT TYPE="text" NAME="ftpusername" VALUE="%%%ftpusername%%%">'.
+ '</TD></TR>'.
+ '<TR><TD ALIGN="right">FTP password: </TD><TD>'.
+ '<INPUT TYPE="text" NAME="ftppassword" VALUE="%%%ftppassword%%%">'.
+ '</TD></TR>'.
+ '<TR><TD ALIGN="right">FTP directory: </TD>'.
+ '<TD><INPUT TYPE="text" NAME="ftpdir" VALUE="%%%ftpdir%%%">'.
+ '</TD></TR>'.
+ '</TABLE>',
+ 'weight' => 50,
+ },
+
'bill' => {
'name' => 'Generate invoices (normally only used with a <i>Late Fee</i> event)',
'code' => '$cust_main->bill();',
diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi
index af89c4ead..bd427aa40 100644
--- a/httemplate/edit/part_export.cgi
+++ b/httemplate/edit/part_export.cgi
@@ -45,15 +45,35 @@ my $widget = new HTML::Widgets::SelectLayers(
if $layer;
foreach my $option ( keys %{$exports->{$layer}{options}} ) {
-# foreach my $option ( qw(url login password groupID ) ) {
my $optinfo = $exports->{$layer}{options}{$option};
my $label = $optinfo->{label};
+ my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
my $value = $cgi->param($option)
|| $part_export->option($option)
- || (exists $optinfo->{default} ? $optinfo->{default} : '');
- $html .= qq!<TR><TD ALIGN="right">$label</TD>!.
- qq!<TD><INPUT TYPE="text" NAME="$option" VALUE="$value" SIZE=64></TD>!.
- '</TR>';
+ || ( (exists $optinfo->{default} && !$part_export->exportnum)
+ ? $optinfo->{default}
+ : ''
+ );
+ $html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
+ if ( $type eq 'select' ) {
+ $html .= qq!<SELECT NAME="$option">!;
+ foreach my $select_option ( @{$optinfo->{options}} ) {
+ #if ( ref($select_option) ) {
+ #} else {
+ $selected = $select_option eq $value ? ' SELECTED' : '';
+ $html .= qq!<OPTION VALUE="$select_option"$selected>!.
+ qq!$select_option</OPTION>!;
+ #}
+ }
+ $html .= '</SELECT>';
+ } elsif ( $type eq 'textarea' ) {
+ $html .= qq!<TEXTAREA NAME="$option">$value</TEXTAREA>!;
+ } elsif ( $type eq 'text' ) {
+ $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="$value" SIZE=64>!;
+ } else {
+ $html .= "unknown type $type";
+ }
+ $html .= '</TD></TR>';
}
$html .= '</TABLE>';
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index e03017db4..38d7358a5 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -67,9 +67,9 @@ print '<FORM NAME="dummy">';
print "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)";
print ntable("#cccccc",2), <<END;
-<TR><TD ALIGN="right">Package (customer-visable)</TD><TD><INPUT TYPE="text" NAME="pkg" SIZE=32 VALUE="$hashref->{pkg}"></TD></TR>
+<TR><TD ALIGN="right">Package (customer-visible)</TD><TD><INPUT TYPE="text" NAME="pkg" SIZE=32 VALUE="$hashref->{pkg}"></TD></TR>
<TR><TD ALIGN="right">Comment (customer-hidden)</TD><TD><INPUT TYPE="text" NAME="comment" SIZE=32 VALUE="$hashref->{comment}"></TD></TR>
-<TR><TD ALIGN="right">Frequency (months) of recurring fee</TD><TD><INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}" SIZE=3></TD></TR>
+<TR><TD ALIGN="right">Frequency (months) of recurring fee</TD><TD><INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}" SIZE=3>&nbsp;&nbsp;<I>0=no recurring fee, 1=monthly, 3=quarterly, 12=yearly</TD></TR>
<TR><TD ALIGN="right">Setup fee tax exempt</TD><TD>
END
@@ -89,6 +89,7 @@ print '>';
print '</TD></TR>';
my $conf = new FS::Conf;
+#false laziness w/ view/cust_main.cgi quick order
if ( $conf->exists('enable_taxclasses') ) {
print '<TR><TD ALIGN="right">Tax class</TD><TD><SELECT NAME="taxclass">';
my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
@@ -240,7 +241,7 @@ tie my %plans, 'Tie::IxHash',
},
'flat_comission_cust' => {
- 'name' => 'Flat rate with recurring comission per active customer',
+ 'name' => 'Flat rate with recurring commission per active customer',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
@@ -248,7 +249,7 @@ tie my %plans, 'Tie::IxHash',
'recur_fee' => { 'name' => 'Recurring fee for this package',
'default' => 0,
},
- 'comission_amount' => { 'name' => 'Comission amount per month (per active customer)',
+ 'comission_amount' => { 'name' => 'Commission amount per month (per active customer)',
'default' => 0,
},
'comission_depth' => { 'name' => 'Number of layers',
@@ -261,7 +262,7 @@ tie my %plans, 'Tie::IxHash',
},
'flat_comission' => {
- 'name' => 'Flat rate with recurring comission per (any) active package',
+ 'name' => 'Flat rate with recurring commission per (any) active package',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
@@ -269,7 +270,7 @@ tie my %plans, 'Tie::IxHash',
'recur_fee' => { 'name' => 'Recurring fee for this package',
'default' => 0,
},
- 'comission_amount' => { 'name' => 'Comission amount per month (per active package)',
+ 'comission_amount' => { 'name' => 'Commission amount per month (per active package)',
'default' => 0,
},
'comission_depth' => { 'name' => 'Number of layers',
@@ -282,7 +283,7 @@ tie my %plans, 'Tie::IxHash',
},
'flat_comission_pkg' => {
- 'name' => 'Flat rate with recurring comission per (selected) active package',
+ 'name' => 'Flat rate with recurring commission per (selected) active package',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
@@ -290,7 +291,7 @@ tie my %plans, 'Tie::IxHash',
'recur_fee' => { 'name' => 'Recurring fee for this package',
'default' => 0,
},
- 'comission_amount' => { 'name' => 'Comission amount per month (per uncancelled package)',
+ 'comission_amount' => { 'name' => 'Commission amount per month (per uncancelled package)',
'default' => 0,
},
'comission_depth' => { 'name' => 'Number of layers',
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
index f2073f935..4ccb770fb 100755
--- a/httemplate/edit/part_svc.cgi
+++ b/httemplate/edit/part_svc.cgi
@@ -144,9 +144,9 @@ my %defs = (
my $columns = 3;
my $count = 0;
my @part_export =
- grep { $layer eq FS::part_export::exporttype2svcdb($_->exporttype) }
- qsearch( 'part_export', {} );
- $html .= '<BR><BR>'. table().
+ map { qsearch( 'part_export', {exporttype => $_ } ) }
+ keys %{FS::part_export::export_info($layer)};
+ $html .= '<BR><BR>'. table().
table(). "<TR><TH COLSPAN=$columns>Exports</TH></TR><TR>";
foreach my $part_export ( @part_export ) {
$html .= '<TD><INPUT TYPE="checkbox"'.
diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi
index 6bed85c19..2e0352c76 100755
--- a/httemplate/edit/process/REAL_cust_pkg.cgi
+++ b/httemplate/edit/process/REAL_cust_pkg.cgi
@@ -5,6 +5,7 @@ my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
my %hash = $old->hash;
$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : '';
$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : '';
+$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : '';
my $new = new FS::cust_pkg \%hash;
my $error = $new->replace($old);
diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi
index 4049ade80..e224bf634 100755
--- a/httemplate/edit/process/part_bill_event.cgi
+++ b/httemplate/edit/process/part_bill_event.cgi
@@ -12,7 +12,7 @@ if ( ! $cgi->param('plan_weight_eventcode') ) {
$error = "Must select an action";
} else {
- $cgi->param('plan_weight_eventcode') =~ /^([\w\-]+):(\d+):(.*)$/
+ $cgi->param('plan_weight_eventcode') =~ /^([\w\-]+):(\d+):(.*)$/s
or die "illegal plan_weight_eventcode:".
$cgi->param('plan_weight_eventcode');
$cgi->param('plan', $1);
diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi
index 6b4d007e4..fa009edbb 100644
--- a/httemplate/edit/process/part_export.cgi
+++ b/httemplate/edit/process/part_export.cgi
@@ -6,7 +6,11 @@ my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum;
#fixup options
#warn join('-', split(',',$cgi->param('options')));
-my %options = map { $_=>$cgi->param($_) } split(',',$cgi->param('options'));
+my %options = map {
+ my $value = $cgi->param($_);
+ $value =~ s/\r\n/\n/g; #browsers? (textarea)
+ $_ => $value;
+} split(',', $cgi->param('options'));
my $new = new FS::part_export ( {
map {
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi
new file mode 100644
index 000000000..477f58508
--- /dev/null
+++ b/httemplate/edit/process/quick-charge.cgi
@@ -0,0 +1,32 @@
+<%
+
+#untaint custnum
+$cgi->param('custnum') =~ /^(\d+)$/
+ or die 'illegal custnum '. $cgi->param('custnum');
+my $custnum = $1;
+
+$cgi->param('amount') =~ /^\s*(\d+(\.\d{1,2})?)\s*$/
+ or die 'illegal amount '. $cgi->param('amount');
+my $amount = $1;
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or die "unknown custnum $custnum";
+
+my $error = $cust_main->charge(
+ $amount,
+ $cgi->param('pkg'),
+ '$'. sprintf("%.2f",$amount),
+ $cgi->param('taxclass')
+);
+
+if ($error) {
+%>
+<!-- mason kludge -->
+<%
+ eidiot($error);
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" );
+}
+
+%>
+
diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi
index c663dce32..a8f5b1453 100644
--- a/httemplate/edit/process/quick-cust_pkg.cgi
+++ b/httemplate/edit/process/quick-cust_pkg.cgi
@@ -2,10 +2,10 @@
#untaint custnum
$cgi->param('custnum') =~ /^(\d+)$/
- or eidiot 'illegal custnum '. $cgi->param('custnum');
+ or die 'illegal custnum '. $cgi->param('custnum');
my $custnum = $1;
$cgi->param('pkgpart') =~ /^(\d+)$/
- or eidiot 'illegal pkgpart '. $cgi->param('pkgpart');
+ or die 'illegal pkgpart '. $cgi->param('pkgpart');
my $pkgpart = $1;
my @cust_pkg = ();
diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi
index 38d5e1c79..40913145a 100644
--- a/httemplate/edit/process/svc_www.cgi
+++ b/httemplate/edit/process/svc_www.cgi
@@ -5,8 +5,8 @@ my $svcnum = $1;
my $old;
if ( $svcnum ) {
- $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } )
- or die "fatal: can't find account (svcnum $svcnum)!";
+ $old = qsearchs('svc_www', { 'svcnum' => $svcnum } )
+ or die "fatal: can't find website (svcnum $svcnum)!";
} else {
$old = '';
}
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index eca0a31cf..90b26324a 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -12,8 +12,8 @@ if ( $cgi->param('error') ) {
$svcnum = $svc_acct->svcnum;
$pkgnum = $cgi->param('pkgnum');
$svcpart = $cgi->param('svcpart');
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
@groups = $cgi->param('radius_usergroup');
} else {
my($query) = $cgi->keywords;
@@ -28,8 +28,8 @@ if ( $cgi->param('error') ) {
$pkgnum=$cust_svc->pkgnum;
$svcpart=$cust_svc->svcpart;
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
@groups = $svc_acct->radius_groups;
@@ -41,8 +41,8 @@ if ( $cgi->param('error') ) {
$pkgnum=$1 if /^pkgnum(\d+)$/;
$svcpart=$1 if /^svcpart(\d+)$/;
}
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
$svcnum='';
diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi
index 5f1466bbb..bc19fe1de 100755
--- a/httemplate/edit/svc_forward.cgi
+++ b/httemplate/edit/svc_forward.cgi
@@ -119,105 +119,58 @@ my($srcsvc,$dstsvc,$dst)=(
#display
-my $p1 = popurl(1);
-print header("Mail Forward $action", '',
- " onLoad=\"visualize()\"");
-
%>
-<SCRIPT>
-function visualize(what){
- if (document.getElementById) {
- document.getElementById('dother').style.visibility = '<%= $dstsvc ? 'hidden' : 'visible' %>';
- }
-}
-function fixup(what){
- if (document.getElementById) {
- if (document.getElementById('dother').style.visibility == 'hidden') {
- what.dst.value='';
- }
- }
-}
-</SCRIPT>
-
-<%
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
+<%= header("Mail Forward $action") %>
-print qq!<FORM ACTION="${p1}process/svc_forward.cgi" onSubmit="fixup(this)" METHOD=POST>!;
+<% if ( $cgi->param('error') ) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+ <BR><BR>
+<% } %>
-#svcnum
-print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
-print qq!Service #<FONT SIZE=+1><B>!, $svcnum ? $svcnum : " (NEW)", "</B></FONT>";
-print qq!<BR>!;
+Service #<%= $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>
+Service: <B><%= $part_svc->svc %></B><BR><BR>
-#pkgnum
-print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
-
-#svcpart
-print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
-
-#srcsvc
-print qq!\n\nMail to <SELECT NAME="srcsvc" SIZE=1>!;
-foreach $_ (keys %email) {
- print "<OPTION", $_ eq $srcsvc ? " SELECTED" : "",
- qq! VALUE="$_">$email{$_}!;
-}
-print "</SELECT>";
+<FORM NAME="dummy">
-#dstsvc
-print qq! forwards to <SELECT NAME="dstsvc" SIZE=1 onChange="changed(this)">!;
-foreach $_ (keys %email) {
- print "<OPTION", $_ eq $dstsvc ? " SELECTED" : "",
- qq! VALUE="$_">$email{$_}!;
-}
-print "<OPTION", 0 eq $dstsvc ? " SELECTED" : "",
- qq! VALUE="0">(other)!;
-print "</SELECT> mailbox.";
-
-%>
-
-<SCRIPT>
-var selectchoice = null;
-function changed(what) {
- selectchoice = what.options[what.selectedIndex].value;
- if (selectchoice == "0") {
- if (document.getElementById) {
- document.getElementById('dother').style.visibility = "visible";
- }
- }else{
- if (document.getElementById) {
- document.getElementById('dother').style.visibility = "hidden";
- }
- }
-}
-if (document.getElementById) {
- document.write("<DIV ID=\"dother\" STYLE=\"visibility: hidden\">");
-}
-</SCRIPT>
+<%= ntable("#cccccc",2) %>
+<TR><TD ALIGN="right">Email to</TD><TD><SELECT NAME="srcsvc" SIZE=1>
+<% foreach $_ (keys %email) { %>
+ <OPTION<%= $_ eq $srcsvc ? " SELECTED" : "" %> VALUE="<%= $_ %>"><%= $email{$_} %></OPTION>
+<% } %>
+</SELECT></TD></TR>
<%
-print qq! Other destination: <INPUT TYPE="text" NAME="dst" VALUE="$dst">!;
+ tie my %tied_email, 'Tie::IxHash',
+ '' => 'SELECT DESTINATION',
+ %email,
+ '0' => '(other email address)';
+ my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => $dstsvc,
+ 'options' => \%tied_email,
+ 'form_name' => 'dummy',
+ 'form_action' => 'process/svc_forward.cgi',
+ 'form_select' => ['srcsvc'],
+ 'html_between' => '</TD></TR></TABLE>',
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!.
+ qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!.
+ qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!.
+ qq!<INPUT TYPE="hidden" NAME="dstsvc" VALUE="$layer">!;
+ if ( $layer eq '0' ) {
+ $html .= ntable("#cccccc",2).
+ '<TR><TD ALIGN="right">Destination email</TD>'.
+ qq!<TD><INPUT TYPE="text" NAME="dst" VALUE="$dst"></TD>!.
+ '</TR></TABLE>';
+ }
+ $html .= '<BR><INPUT TYPE="submit" VALUE="Submit">';
+ $html;
+ },
+ );
%>
-<SCRIPT>
-if (document.getElementById) {
- document.write("</DIV>");
-}
-</SCRIPT>
-
-<CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>
-</FORM>
-
-<TAG onLoad="
- if (document.getElementById) {
- document.getElementById('dother').style.visibility = '<%= $dstsvc ? 'hidden' : 'visible' %>';
- document.getElementById('dlabel').style.visibility = '<%= $dstsvc ? 'hidden' : 'visible' %>';
- }
-">
-
-
+<TR><TD ALIGN="right">Forwards to</TD>
+<TD><%= $widget->html %>
</BODY>
</HTML>
diff --git a/httemplate/edit/svc_www.cgi b/httemplate/edit/svc_www.cgi
index e1a914f1a..d2c9ade5c 100644
--- a/httemplate/edit/svc_www.cgi
+++ b/httemplate/edit/svc_www.cgi
@@ -175,5 +175,4 @@ print <<END;
</BODY>
</HTML>
END
-
-
+%>