diff options
Diffstat (limited to 'fs_selfservice/FS-SelfService')
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/bill.html | 7 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/card.html | 73 | ||||
-rwxr-xr-x | fs_selfservice/FS-SelfService/cgi/change_bill.html | 25 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/change_pay.html | 75 | ||||
-rwxr-xr-x | fs_selfservice/FS-SelfService/cgi/change_ship.html | 104 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/check.html | 54 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/contact.html | 135 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/make_ach_payment.html | 56 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/make_payment.html | 69 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/myaccount_menu.html | 5 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/process_change_bill.html | 13 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/process_change_pay.html | 13 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/process_change_ship.html | 13 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 70 |
14 files changed, 588 insertions, 124 deletions
diff --git a/fs_selfservice/FS-SelfService/cgi/bill.html b/fs_selfservice/FS-SelfService/cgi/bill.html new file mode 100644 index 000000000..bbdf1f210 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/bill.html @@ -0,0 +1,7 @@ +<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> diff --git a/fs_selfservice/FS-SelfService/cgi/card.html b/fs_selfservice/FS-SelfService/cgi/card.html new file mode 100644 index 000000000..cf6d20d8d --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/card.html @@ -0,0 +1,73 @@ +<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> diff --git a/fs_selfservice/FS-SelfService/cgi/change_bill.html b/fs_selfservice/FS-SelfService/cgi/change_bill.html new file mode 100755 index 000000000..0bc47d069 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/change_bill.html @@ -0,0 +1,25 @@ +<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> diff --git a/fs_selfservice/FS-SelfService/cgi/change_pay.html b/fs_selfservice/FS-SelfService/cgi/change_pay.html new file mode 100644 index 000000000..d26abfa7a --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/change_pay.html @@ -0,0 +1,75 @@ +<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> diff --git a/fs_selfservice/FS-SelfService/cgi/change_ship.html b/fs_selfservice/FS-SelfService/cgi/change_ship.html new file mode 100755 index 000000000..1a3b85d6d --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/change_ship.html @@ -0,0 +1,104 @@ +<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> diff --git a/fs_selfservice/FS-SelfService/cgi/check.html b/fs_selfservice/FS-SelfService/cgi/check.html new file mode 100644 index 000000000..68753fe08 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/check.html @@ -0,0 +1,54 @@ +<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> diff --git a/fs_selfservice/FS-SelfService/cgi/contact.html b/fs_selfservice/FS-SelfService/cgi/contact.html new file mode 100644 index 000000000..20c15df78 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/contact.html @@ -0,0 +1,135 @@ +<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> !; +--> diff --git a/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html b/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html index 83d36b9b9..f80142325 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_ach_payment.html @@ -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 diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html index 64b1e00b5..89239c06b 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html @@ -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 diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html index defd817c0..ec5a8fa42 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html @@ -39,8 +39,9 @@ push @menu, ( { 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=>' ' }, diff --git a/fs_selfservice/FS-SelfService/cgi/process_change_bill.html b/fs_selfservice/FS-SelfService/cgi/process_change_bill.html new file mode 100644 index 000000000..66a71e6e8 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/process_change_bill.html @@ -0,0 +1,13 @@ +<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> + diff --git a/fs_selfservice/FS-SelfService/cgi/process_change_pay.html b/fs_selfservice/FS-SelfService/cgi/process_change_pay.html new file mode 100644 index 000000000..66a71e6e8 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/process_change_pay.html @@ -0,0 +1,13 @@ +<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> + diff --git a/fs_selfservice/FS-SelfService/cgi/process_change_ship.html b/fs_selfservice/FS-SelfService/cgi/process_change_ship.html new file mode 100644 index 000000000..66a71e6e8 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/process_change_ship.html @@ -0,0 +1,13 @@ +<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> + diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index b5a672059..36557b662 100644 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -9,7 +9,7 @@ use Text::Template; 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 @@ $session_id = $cgi->param('session'); #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 @@ do_template($action, { 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 @@ package FS::SelfService::_selfservicecgi; #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 { |