[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi bill.html, 1.1, 1.2 card.html, 1.1, 1.2 change_bill.html, 1.1, 1.2 change_pay.html, 1.1, 1.2 change_ship.html, 1.1, 1.2 check.html, 1.1, 1.2 contact.html, 1.1, 1.2 process_change_bill.html, 1.1, 1.2 process_change_pay.html, 1.1, 1.2 process_change_ship.html, 1.1, 1.2 make_ach_payment.html, 1.1, 1.2 make_payment.html, 1.13, 1.14 myaccount_menu.html, 1.9, 1.10 selfservice.cgi, 1.27, 1.28
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Jan 23 11:18:41 PST 2008
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail:/tmp/cvs-serv20526/fs_selfservice/FS-SelfService/cgi
Modified Files:
make_ach_payment.html make_payment.html myaccount_menu.html
selfservice.cgi
Added Files:
bill.html card.html change_bill.html change_pay.html
change_ship.html check.html contact.html
process_change_bill.html process_change_pay.html
process_change_ship.html
Log Message:
change service, billing, and payment info in selfservice
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- selfservice.cgi 12 Dec 2007 05:58:42 -0000 1.27
+++ selfservice.cgi 23 Jan 2008 19:18:39 -0000 1.28
@@ -9,7 +9,7 @@
use HTML::Entities;
use Date::Format;
use Number::Format 1.50;
-use FS::SelfService qw( login customer_info invoice
+use FS::SelfService qw( login customer_info edit_info invoice
payment_info process_payment
process_prepay
list_pkgs order_pkg signup_info order_recharge
@@ -68,7 +68,7 @@
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|view_invoice|make_payment|make_ach_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_support_details|change_password|process_change_password)$/
+ /^(myaccount|view_invoice|make_payment|make_ach_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_support_details|change_password|process_change_password)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
@@ -100,6 +100,70 @@
sub myaccount { customer_info( 'session_id' => $session_id ); }
+sub change_bill { my $payment_info =
+ payment_info( 'session_id' => $session_id );
+ return $payment_info if ( $payment_info->{'error'} );
+ my $customer_info =
+ customer_info( 'session_id' => $session_id );
+ return {
+ %$payment_info,
+ %$customer_info,
+ };
+ }
+sub change_ship { change_bill(@_); }
+sub change_pay { change_bill(@_); }
+
+sub _process_change_info {
+ my ($erroraction, @fields) = @_;
+
+ my $results = '';
+
+ $results ||= edit_info (
+ 'session_id' => $session_id,
+ map { ($_ => $cgi->param($_)) } grep { defined($cgi->param($_)) } @fields,
+ );
+
+
+ if ( $results->{'error'} ) {
+ no strict 'refs';
+ $action = $erroraction;
+ return {
+ $cgi->Vars,
+ %{&$action()},
+ 'error' => '<FONT COLOR="#FF0000">'. $results->{'error'}. '</FONT>',
+ };
+ } else {
+ return $results;
+ }
+}
+
+sub process_change_bill {
+ _process_change_info( 'change_bill',
+ qw( first last company address1 address2 city state
+ county state zip country daytime night fax )
+ );
+}
+
+sub process_change_ship {
+ my @list = map { "ship_$_" }
+ qw( first last company address1 address2 city state
+ county zip country daytime night fax
+ );
+ if ($cgi->param('same') eq 'Y') {
+ foreach (@list) { $cgi->param($_, '') }
+ }
+
+ _process_change_info( 'change_ship', @list );
+}
+
+sub process_change_pay {
+ _process_change_info( 'change_pay',
+ qw( payby payinfo payinfo1 payinfo2 month year payname
+ address1 address2 city county state zip country auto paytype
+ paystate ss stateid stateid_state )
+ );
+}
+
sub view_invoice {
$cgi->param('invnum') =~ /^(\d+)$/ or die "illegal invnum";
@@ -563,7 +627,7 @@
#use FS::SelfService qw(regionselector expselect popselector);
use HTML::Entities;
-use FS::SelfService qw(popselector domainselector);
+use FS::SelfService qw(regionselector popselector domainselector);
#false laziness w/agent.cgi
sub include {
--- NEW FILE: process_change_bill.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Information updated successfully.</FONT>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
--- NEW FILE: bill.html ---
<TR>
<TD ALIGN="right">P.O. number</TD>
<TD><INPUT TYPE="text" NAME="payinfo" SIZE=10 MAXLENGTH=20 VALUE="<%=$payinfo%>"></TD>
</TR><TR>
<TD ALIGN="right">Attention</TD>
<TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
</TR>
Index: myaccount_menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- myaccount_menu.html 22 Sep 2007 22:45:30 -0000 1.9
+++ myaccount_menu.html 23 Jan 2008 19:18:39 -0000 1.10
@@ -39,8 +39,9 @@
{ title=>' ' },
{ title=>'Change my information', size=>'+1', },
-# { title=>'Change payment information*', url=>'change_bill', indent=>2 },
-# { title=>'Change service address*', url=>'change_ship', indent=>2 },
+ { title=>'Change billing address', url=>'change_bill', indent=>2 },
+ { title=>'Change service address', url=>'change_ship', indent=>2 },
+ { title=>'Change payment information', url=>'change_pay', indent=>2 },
{ title=>'Change password(s)', url=>'change_password', indent=>2 },
{ title=>' ' },
--- NEW FILE: process_change_ship.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Information updated successfully.</FONT>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
--- NEW FILE: check.html ---
<TR>
<TD ALIGN="right">Account type</TD>
<TD>
<SELECT NAME="paytype">
<%= foreach ( @paytypes ) {
$selected = $paytype eq $_ ? ' SELECTED' : '';
$OUT .= qq(<OPTION$selected VALUE="$_">$_\n);
} %>
</SELECT>
</TD>
</TD><TR>
<TD ALIGN="right">Account number</TD>
<TD><INPUT TYPE="text" NAME="payinfo1" SIZE=10 MAXLENGTH=20 VALUE="<%=$payinfo1%>"></TD>
</TD><TR>
<TD ALIGN="right">ABA/Routing number</TD>
<TD><INPUT TYPE="text" NAME="payinfo2" SIZE=10 MAXLENGTH=9 VALUE="<%=$payinfo2%>"></TD>
</TR><TR>
<TD ALIGN="right">Bank name</TD>
<TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
</TR><TR>
<%=
$OUT = '';
if ($show_paystate) {
$OUT .= qq!<TD ALIGN="right">Bank state</TD><TD><SELECT NAME="paystate">!;
for ( @states ) {
$OUT .= '<OPTION'. ($_ eq $paystate ? ' SELECTED' : '' ). ">$_\n";
}
$OUT .= '</SELECT></TD></TR><TR>';
}
%>
<%=
$OUT = '';
if ($show_ss) {
$OUT .= '<TD ALIGN="right">Account holder<BR>Social ';
$OUT .= 'security or tax ID #</TD><TD>';
$OUT .= qq!<INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="ss" VALUE="$ss">!;
$OUT .= '</TD></TR><TR>';
}
%>
<%=
$OUT = '';
if ($show_stateid) {
$OUT .= '<TD ALIGN="right">';
$OUT .= qq!Account holder<BR>$stateid_label</TD><TD>!;
$OUT .= qq!<INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="stateid" VALUE="$stateid"></TD>!;
$OUT .= qq!<TD ALIGN="right">$stateid_state_label</TD>!;
$OUT .= '<TD><SELECT NAME="stateid_state">';
for ( @states ) {
$OUT .= '<OPTION'. ($_ eq $stateid_state ? ' SELECTED' : '' ). ">$_\n";
}
$OUT .='</SELECT></TD></TR><TR>';
}
%>
</TR>
Index: make_ach_payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- make_ach_payment.html 29 Apr 2007 22:55:14 -0000 1.1
+++ make_ach_payment.html 23 Jan 2008 19:18:39 -0000 1.2
@@ -36,59 +36,9 @@
$<INPUT TYPE="text" NAME="amount" SIZE=8 VALUE="<%=sprintf("%.2f",$balance)%>">
</TD></TR></TABLE>
</TD>
-</TR><TR>
- <TD ALIGN="right">Account type</TD>
- <TD>
- <SELECT NAME="paytype"><OPTION></OPTION>
- <%= foreach ( @paytypes ) {
- $selected = $paytype eq $_ ? ' SELECTED' : '';
- $OUT .= qq(<OPTION$selected VALUE="$_">$_\n);
- } %>
- </SELECT>
- </TD>
-</TD><TR>
- <TD ALIGN="right">Account number</TD>
- <TD><INPUT TYPE="text" NAME="payinfo1" SIZE=10 MAXLENGTH=20 VALUE="<%=$payinfo1%>"></TD>
-</TD><TR>
- <TD ALIGN="right">ABA/Routing number</TD>
- <TD><INPUT TYPE="text" NAME="payinfo2" SIZE=10 MAXLENGTH=9 VALUE="<%=$payinfo2%>"></TD>
-</TR><TR>
- <TD ALIGN="right">Bank name</TD>
- <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
-</TR><TR>
- <%=
- $OUT = '';
- if ($show_paystate) {
- $OUT .= qq!<TD ALIGN="right">Bank state</TD><TD><SELECT NAME="paystate">!;
- for ( @states ) {
- $OUT .= '<OPTION'. ($_ eq $paystate ? ' SELECTED' : '' ). ">$_\n";
- }
- $OUT .= '</SELECT></TD></TR><TR>';
- }
- %>
- <%=
- $OUT = '';
- if ($show_ss) {
- $OUT .= '<TD ALIGN="right">Account holder<BR>Social ';
- $OUT .= 'security or tax ID #</TD><TD>';
- $OUT .= qq!<INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="ss" VALUE="$ss">!;
- $OUT .= '</TD></TR><TR>';
- }
- %>
- <%=
- $OUT = '';
- if ($show_stateid) {
- $OUT .= '<TD ALIGN="right">';
- $OUT .= qq!Account holder<BR>$stateid_label</TD><TD>!;
- $OUT .= qq!<INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="stateid" VALUE="$stateid"></TD>!;
- $OUT .= qq!<TD ALIGN="right">$stateid_state_label</TD>!;
- $OUT .= '<TD><SELECT NAME="stateid_state">';
- for ( @states ) {
- $OUT .= '<OPTION'. ($_ eq $stateid_state ? ' SELECTED' : '' ). ">$_\n";
- }
- $OUT .='</SELECT></TD></TR><TR>';
- }
- %>
+</TR>
+<%= include('check') %>
+<TR>
<TD COLSPAN=2>
<INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1">
Remember this information
--- NEW FILE: contact.html ---
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
<TR>
<TH ALIGN="right"><%=$r%>Contact name<BR>(last, first)</TH>
<TD COLSPAN=5>
<INPUT TYPE="text" NAME="<%=$pre%>last" VALUE="<%= ${$pre.'last'} %>" onChange="<%= $onchange %>" <%=$disabled%>> ,
<INPUT TYPE="text" NAME="<%=$pre%>first" VALUE="<%= ${$pre.'first'} %>" onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
<TR>
<TD ALIGN="right">Company</TD>
<TD COLSPAN=7>
<INPUT TYPE="text" NAME="<%=$pre%>company" VALUE="<%= ${$pre.'company'} %>" SIZE=70 onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
<TR>
<TH ALIGN="right"><%=$r%>Address</TH>
<TD COLSPAN=7>
<INPUT TYPE="text" NAME="<%=$pre%>address1" VALUE="<%= ${$pre.'address1'} %>" SIZE=70 onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
<TR>
<TD ALIGN="right">
<%=
my $style =
( $disabled
|| !$require_address2
|| ( !$pre && $ship_last )
)
? 'visibility:hidden'
: '';
$OUT .= qq!<FONT ID="${pre}address2_required" color="#ff0000" STYLE="$style">*</FONT> <FONT ID="${pre}address2_label" STYLE="$style"><B>Unit #</B></FONT>!;
%>
</TD>
<TD COLSPAN=7>
<INPUT TYPE="text" NAME="<%=$pre%>address2" VALUE="<%= ${$pre.'address2'} %>" SIZE=70 onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
<TR>
<TH ALIGN="right"><%=$r%>City</TH>
<TD>
<INPUT TYPE="text" ID="<%=$pre%>city" NAME="<%=$pre%>city" VALUE="<%= ${$pre.'city'} %>" onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
<%=
($county_html, $state_html, $country_html) =
FS::SelfService::regionselector( {
prefix => $pre,
selected_county => ${$pre.'county'},
selected_state => ${$pre.'state'},
selected_country => ${$pre.'country'},
default_state => $statedefault,
default_country => $countrydefault,
locales => \@cust_main_county,
} );
$OUT .= qq!<TH ALIGN="right">${r}State/County</TH>!;
$OUT .= qq!<TD>$county_html $state_html</TD>!;
$OUT .= qq!<TH>${r}Zip</TH>!;
$OUT .= qq!<TD><INPUT TYPE="text" NAME="${pre}zip" VALUE="${$pre.'zip'}" SIZE=10 onChange="$onchange" $disabled></TD>!;
$OUT .= qq!</TR>!;
$OUT .= qq!<TR>!;
$OUT .= qq!<TH ALIGN="right">${r}Country</TH>!;
$OUT .= qq!<TD COLSPAN=5>$country_html</TD>!;
%>
</TR>
<SCRIPT>
<%=
if ( $disabled ) {
$OUT .= qq!var what = document.getElementById("${pre}city");!;
for (qw( county state country ) ) {
$OUT .= "what.form.$pre$_.disabled = true;";
$OUT .= "what.form.$pre$_.style.backgroundColor = '#dddddd';";
}
}else{
'';
}
%>
</SCRIPT>
<TR>
<TD ALIGN="right">Day Phone</TD>
<TD COLSPAN=5>
<INPUT TYPE="text" NAME="<%=$pre%>daytime" VALUE="<%= ${$pre.'daytime'} %>" SIZE=18 onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
<TR>
<TD ALIGN="right">Night Phone</TD>
<TD COLSPAN=5>
<INPUT TYPE="text" NAME="<%=$pre%>night" VALUE="<%= ${$pre.'night'} %>" SIZE=18 onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
<TR>
<TD ALIGN="right">Fax</TD>
<TD COLSPAN=5>
<INPUT TYPE="text" NAME="<%=$pre%>fax" VALUE="<%= ${$pre.'fax'} %>" SIZE=12 onChange="<%= $onchange %>" <%=$disabled%>>
</TD>
</TR>
</TABLE>
<%=$r%>required fields<BR>
<!--
#my($county_html, $state_html, $country_html) =
# FS::cust_main_county::regionselector( $cust_main->get($pre.'county'),
# $cust_main->get($pre.'state'),
# $cust_main->get($pre.'country'),
# $pre,
# $onchange,
# $disabled,
# );
my %select_hash = (
'county' => ${$pre.'county'},
'state' => ${$pre.'state'},
'country' => ${$pre.'country'},
'prefix' => $pre,
'onchange' => $onchange,
'disabled' => $disabled,
);
my @counties = counties( ${$pre.'state'},
${$pre.'country'},
);
my $county_style = scalar(@counties) > 1 ? '' : 'STYLE="visibility:hidden"';
my $r = qq!<font color="#ff0000">*</font> !;
-->
Index: make_payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/make_payment.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- make_payment.html 22 Jan 2007 02:42:08 -0000 1.13
+++ make_payment.html 23 Jan 2008 19:18:39 -0000 1.14
@@ -46,72 +46,9 @@
} %>
</SELECT>
</TD>
-</TD><TR>
- <TD ALIGN="right">Card number</TD>
- <TD>
- <TABLE>
- <TR>
- <TD>
- <INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<%=$payinfo%>"> </TD>
- <TD>Exp.</TD>
- <TD>
- <SELECT NAME="month">
- <%= for ( ( map "0$_", 1 .. 9 ), 10 .. 12 ) {
- $OUT .= '<OPTION'. ($_ == $month ? ' SELECTED' : ''). ">$_\n";
- } %>
- </SELECT>
- </TD>
- <TD> / </TD>
- <TD>
- <SELECT NAME="year">
- <%= my @a = localtime; for ( $a[5]+1900 .. $a[5]+1915 ) {
- $OUT .= '<OPTION'. ($_ == $year ? ' SELECTED' : ''). ">$_\n";
- } %>
- </SELECT>
- </TD>
- </TR>
- </TABLE>
- </TD>
-</TR><TR>
- <TD ALIGN="right">CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD>
- <TD><INPUT TYPE="text" NAME="paycvv" VALUE="" SIZE=4 MAXLENGTH=4></TD></TR>
-</TR><TR>
- <TD ALIGN="right">Exact name on card</TD>
- <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
-</TR><TR>
- <TD ALIGN="right">Card billing address</TD>
- <TD>
- <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address1" VALUE="<%=$address1%>">
- </TD>
-</TR><TR>
- <TD ALIGN="right">Address line 2</TD>
- <TD>
- <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address2" VALUE="<%=$address2%>">
- </TD>
-</TR><TR>
- <TD ALIGN="right">City</TD>
- <TD>
- <TABLE>
- <TR>
- <TD>
- <INPUT TYPE="text" NAME="city" SIZE="12" MAXLENGTH=80 VALUE="<%=$city%>">
- </TD>
- <TD>State</TD>
- <TD>
- <SELECT NAME="state">
- <%= for ( @states ) {
- $OUT .= '<OPTION'. ($_ eq $state ? ' SELECTED' : '' ). ">$_\n";
- } %>
- </SELECT>
- </TD>
- <TD>Zip</TD>
- <TD>
- <INPUT TYPE="text" NAME="zip" SIZE=11 MAXLENGTH=10 VALUE="<%=$zip%>">
- </TD>
- </TR>
- </TABLE>
- </TD>
-</TR><TR>
+</TR>
+<%= include('card') %>
+<TR>
<TD COLSPAN=2>
<INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1">
Remember this information
--- NEW FILE: change_bill.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee">
<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Edit billing address</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
} ''; %>
<FORM NAME="ChangeBillForm" ACTION="<%= $selfurl %>" METHOD=POST onSubmit="document.bottomform.submit.disabled=true;">
<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
<INPUT TYPE="hidden" NAME="action" VALUE="process_change_bill">
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
<%= $r=qq!<font color="#ff0000">*</font> !; include('contact') %>
<INPUT TYPE="submit" NAME="submit" VALUE="<%= $custnum ? "Apply Changes" : "Add Customer" %>">
<BR>
</FORM>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
--- NEW FILE: change_ship.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee">
<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Edit service address</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
} ''; %>
<FORM NAME="OneTrueForm" ACTION="<%= $selfurl %>" METHOD=POST onSubmit="document.bottomform.submit.disabled=true;">
<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
<INPUT TYPE="hidden" NAME="action" VALUE="process_change_ship">
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
<%=
foreach (
qw( last first company address1 address2 city county state zip country
daytime night fax )
) {
$OUT .= qq!<INPUT TYPE="hidden" NAME="$_" VALUE="${$_}">!;
};
'';
%>
<SCRIPT>
function bill_changed(what) {
if ( what.form.same.checked ) {
<%=
for (qw( last first company address1 address2 city zip daytime night fax )) {
$OUT .= "what.form.ship_$_.value = what.form.$_.value;";
}
'';
%>
what.form.ship_country.selectedIndex = what.form.country.selectedIndex;
function fix_ship_county() {
what.form.ship_county.selectedIndex = what.form.county.selectedIndex;
}
function fix_ship_state() {
what.form.ship_state.selectedIndex = what.form.state.selectedIndex;
ship_state_changed(what.form.ship_state, fix_ship_county );
}
ship_country_changed(what.form.ship_country, fix_ship_state );
}
}
function samechanged(what) {
if ( what.checked ) {
bill_changed(what);
<%=
for (qw( last first company address1 address2 city county state zip country daytime night fax )) {
$OUT .= "what.form.ship_$_.disabled = true;";
$OUT .= "what.form.ship_$_.style.backgroundColor = '#dddddd';";
}
if ( $require_address2 ) {
$OUT .= "document.getElementById('ship_address2_required').style.visibility = 'hidden';";
$OUT .= "document.getElementById('ship_address2_label').style.visibility = 'hidden';";
}
%>
} else {
<%=
for (qw( last first company address1 address2 city county state zip country daytime night fax )) {
$OUT .= "what.form.ship_$_.disabled = false;";
$OUT .= "what.form.ship_$_.style.backgroundColor = '#ffffff';";
}
if ( $require_address2 ) {
$OUT .= "document.getElementById('ship_address2_required').style.visibility = '';";
$OUT .= "document.getElementById('ship_address2_label').style.visibility = '';";
}
%>
}
}
</SCRIPT>
(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)"
<%= (!$ship_last || $cgi->param('same') eq 'Y') ? 'CHECKED' : '' %>
>same as billing address)
<%= $r=qq!<font color="#ff0000">*</font> !;
if (!$ship_last || $cgi->param('same') eq 'Y') {
$disabled = 'DISABLED STYLE="background-color: #dddddd"';
foreach ( qw( last first company address1 address2 city county state
zip country daytime night fax )
) {
${"ship_$_"} = ${$_};
}
}else{
$disabled = '';
}
$pre = 'ship_';
include('contact');
%>
<INPUT TYPE="submit" NAME="submit" VALUE="<%= $custnum ? "Apply Changes" : "Add Customer" %>">
<BR>
</FORM>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
--- NEW FILE: change_pay.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee">
<script language="JavaScript"><!--
var mywindow = -1;
function myopen(filename,windowname,properties) {
myclose();
mywindow = window.open(filename,windowname,properties);
}
function myclose() {
if ( mywindow != -1 )
mywindow.close();
mywindow = -1
}
//--></script>
<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Change payment information</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
} ''; %>
<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true">
<%=
use Tie::IxHash;
use HTML::Widgets::SelectLayers;
my $preauto = '<TR><TD COLSPAN=3><INPUT TYPE="checkbox" NAME="auto" VALUE="1"';
my $postauto = '>Charge future payments to this card automatically</TD></TR>';
my $tail = qq(</TABLE><INPUT TYPE="hidden" NAME="session" VALUE="$session_id">).
qq(<INPUT TYPE="hidden" NAME="action" VALUE="process_change_pay">).
qq(<BR>).
qq(<INPUT TYPE="submit" NAME="process" ).
qq(VALUE="Save payment information"> ).
qq(<!-- onClick="this.disabled=true"> -->);
my %paybychecked = (
'BILL' => include('bill'),
'CARD' => include('card')."$preauto CHECKED $postauto",
'DCRD' => include('card')."$preauto $postauto",
'CHEK' => include('check')."$preauto CHECKED $postauto",
'DCHK' => include('check')."$preauto $postauto",
);
my %payby_index = ( 'CARD' => qq/Credit Card/,
'DCRD' => qq/Credit Card/,
'CHEK' => qq/Check/,
'DCHK' => qq/Check/,
'LECB' => qq/Phone Bill Billing/,
'BILL' => qq/Billing/,
'COMP' => qq/Complimentary/,
'PREPAY' => qq/Prepaid Card/,
);
tie my %options, 'Tie::IxHash', ();
foreach my $payby_option ( @paybys ) {
$options{$payby_option} = $payby_index{$payby_option};
}
$options{$payby} = $payby_index{$payby}
unless exists($options{$payby});
HTML::Widgets::SelectLayers->new(
options => \%options,
selected_layer => $payby,
# form_name => 'dummy',
# form_action => 'dummy.cgi',
layer_callback => sub { my $layer = shift; return '<TABLE BGCOLOR="#cccccc">'.$paybychecked{$layer}.qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$layer">$tail!; },
)->html;
%>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
--- NEW FILE: process_change_pay.html ---
<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
<FONT SIZE=4>Information updated successfully.</FONT>
</TD></TR></TABLE>
<HR>
<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
</BODY></HTML>
--- NEW FILE: card.html ---
<TR>
<TD ALIGN="right">Card number</TD>
<TD>
<TABLE>
<TR>
<TD>
<INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<%=$payinfo%>"> </TD>
<TD>Exp.</TD>
<TD>
<SELECT NAME="month">
<%= for ( ( map "0$_", 1 .. 9 ), 10 .. 12 ) {
$OUT .= '<OPTION'. ($_ == $month ? ' SELECTED' : ''). ">$_\n";
} %>
</SELECT>
</TD>
<TD> / </TD>
<TD>
<SELECT NAME="year">
<%= my @a = localtime; for ( $a[5]+1900 .. $a[5]+1915 ) {
$OUT .= '<OPTION'. ($_ == $year ? ' SELECTED' : ''). ">$_\n";
} %>
</SELECT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<%=
if ( $withcvv ) {
$OUT .= qq!<TR>!;
$OUT .= qq!<TD ALIGN="right">CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD>!;
$OUT .= qq!<TD><INPUT TYPE="text" NAME="paycvv" VALUE="" SIZE=4 MAXLENGTH=4></TD>!;
$OUT .= qq!</TR>!;
}
'';
%>
<TR>
<TD ALIGN="right">Exact name on card</TD>
<TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
</TR><TR>
<TD ALIGN="right">Card billing address</TD>
<TD>
<INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address1" VALUE="<%=$address1%>">
</TD>
</TR><TR>
<TD ALIGN="right">Address line 2</TD>
<TD>
<INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address2" VALUE="<%=$address2%>">
</TD>
</TR><TR>
<TD ALIGN="right">City</TD>
<TD>
<TABLE>
<TR>
<TD>
<INPUT TYPE="text" NAME="city" SIZE="12" MAXLENGTH=80 VALUE="<%=$city%>">
</TD>
<TD>State</TD>
<TD>
<SELECT NAME="state">
<%= for ( @states ) {
$OUT .= '<OPTION'. ($_ eq $state ? ' SELECTED' : '' ). ">$_\n";
} %>
</SELECT>
</TD>
<TD>Zip</TD>
<TD>
<INPUT TYPE="text" NAME="zip" SIZE=11 MAXLENGTH=10 VALUE="<%=$zip%>">
</TD>
</TR>
</TABLE>
</TD>
</TR>
More information about the freeside-commits
mailing list