Yesterday i post here wrong and incomplete instructions how to add Back
button. But as i can see nobody get it. Thanx .GOD ;)
Sorry guys for errors, it is 4 am here ... :)
So here as complete as i possible for me instructions.
Changes in reg_system.cgi:
1. add to line 628 (must be empty in 2.0.1)
%HTML = %in; ############### <--- SVK ###
so after adding there must be something like this
sub do_setup_profile {
my (%HTML,$domain,$domain_string,@domains,%domain_info);
my $reg_username = $in{reg_username};
my $reg_password = $in{reg_password};
my $confirm_password = $in{confirm_password};
my $flag_get_userinfo = $in{flag_get_userinfo};
my $reg_domain = $in{reg_domain};
%HTML = %in; ###################### <--- SVK ###
if ($reg_username =~ /^\s*$/) {
error_out("Please provide a username.\n");
exit;
2. in sub do_setup_profile
change
# make a new profile
$HTML{reg_profile} = "New";
$HTML{country_menu} = build_country_list();
$HTML{billing_country_menu} = $HTML{country_menu};
}
$HTML{CGI} = $cgi;
$HTML{reg_username} = $reg_username;
$HTML{reg_password} = $reg_password;
$HTML{affiliate_id} = $in{affiliate_id};
$HTML{reg_type} = $in{reg_type};
$HTML{bulk_order} = $in{bulk_order};
$HTML{CC_YEARS} = build_select_menu(get_cc_years(),(localtime)[5] + 1900);
if ($REG_SYSTEM{custom_tech_contact}) {
$HTML{CUSTOM_TECH_CONTACT} = build_tech_contact(\%domain_info);
}
# nameserver information is only relevant for new domains
to
# make a new profile
%domain_info = %in;############### <--- SVK ###
$HTML{reg_profile} = "New";
$HTML{country_menu} = build_country_list();
$HTML{billing_country_menu} = $HTML{country_menu};
}
$HTML{CGI} = $cgi;
$HTML{reg_username} = $reg_username;
$HTML{reg_password} = $reg_password;
$HTML{confirm_password} = $confirm_password;######### <--- SVK ###
$HTML{affiliate_id} = $in{affiliate_id};
$HTML{reg_type} = $in{reg_type};
$HTML{bulk_order} = $in{bulk_order};
$HTML{CC_YEARS} = build_select_menu(get_cc_years(),(localtime)[5] + 1900);
if ($REG_SYSTEM{custom_tech_contact}) {
$HTML{CUSTOM_TECH_CONTACT} = build_tech_contact(\%domain_info);
}
# nameserver information is only relevant for new domains
3. Replace sub error_out to
sub error_out {
my (%HTML);
my $action = $in{action};
%HTML = %in;
if($action eq "lookup") {$HTML{action} = "";}
elsif($action eq "setup_profile") {$HTML{action} = "";}
elsif($action eq "do_setup_profile") {$HTML{action} = "setup_profile";}
elsif($action eq "verify_order") {$HTML{action} = "do_setup_profile";}
elsif($action eq "register") {$HTML{action} = "verify_order";}
else{$HTML{action} = "";}
$HTML{CGI} = $cgi;
$HTML{ERROR} = shift;
print_form("$path_templates/error.html",\%HTML);
}
In error.html:
Just add following code to the end of file
<!--Begin-->
<FORM method="post" action="{{CGI}}">
<INPUT type=hidden name="affiliate_id" value="{{affiliate_id}}">
<INPUT type=hidden name="reg_username" value="{{reg_username}}">
<INPUT type=hidden name="reg_password" value="{{reg_password}}">
<INPUT type=hidden name="confirm_password" value="{{confirm_password}}">
<INPUT type=hidden name="reg_domain" value="{{reg_domain}}">
<INPUT type=hidden name="reg_type" value="{{reg_type}}">
<INPUT type=hidden name="domain" value="{{domain}}">
<INPUT type=hidden name="bulk_order" value="{{bulk_order}}">
{{domain_string}}
<INPUT type=hidden name="period" value="{{period}}">
<INPUT type=hidden name="owner_first_name" value="{{owner_first_name}}">
<INPUT type=hidden name="owner_last_name" value="{{owner_last_name}}">
<INPUT type=hidden name="owner_org_name" value="{{owner_org_name}}">
<INPUT type=hidden name="owner_address1" value="{{owner_address1}}">
<INPUT type=hidden name="owner_address2" value="{{owner_address2}}">
<INPUT type=hidden name="owner_address3" value="{{owner_address3}}">
<INPUT type=hidden name="owner_city" value="{{owner_city}}">
<INPUT type=hidden name="owner_state" value="{{owner_state}}">
<INPUT type=hidden name="owner_country" value="{{owner_country}}">
<INPUT type=hidden name="owner_postal_code" value="{{owner_postal_code}}">
<INPUT type=hidden name="owner_phone" value="{{owner_phone}}">
<INPUT type=hidden name="owner_fax" value="{{owner_fax}}">
<INPUT type=hidden name="owner_email" value="{{owner_email}}">
<INPUT type=hidden name="billing_first_name" value="{{billing_first_name}}">
<INPUT type=hidden name="billing_last_name" value="{{billing_last_name}}">
<INPUT type=hidden name="billing_org_name" value="{{billing_org_name}}">
<INPUT type=hidden name="billing_address1" value="{{billing_address1}}">
<INPUT type=hidden name="billing_address2" value="{{billing_address2}}">
<INPUT type=hidden name="billing_address3" value="{{billing_address3}}">
<INPUT type=hidden name="billing_city" value="{{billing_city}}">
<INPUT type=hidden name="billing_state" value="{{billing_state}}">
<INPUT type=hidden name="billing_country" value="{{billing_country}}">
<INPUT type=hidden name="billing_postal_code" value="{{billing_postal_code}}">
<INPUT type=hidden name="billing_phone" value="{{billing_phone}}">
<INPUT type=hidden name="billing_fax" value="{{billing_fax}}">
<INPUT type=hidden name="billing_email" value="{{billing_email}}">
<INPUT type=hidden name="tech_first_name" value="{{tech_first_name}}">
<INPUT type=hidden name="tech_last_name" value="{{tech_last_name}}">
<INPUT type=hidden name="tech_org_name" value="{{tech_org_name}}">
<INPUT type=hidden name="tech_address1" value="{{tech_address1}}">
<INPUT type=hidden name="tech_address2" value="{{tech_address2}}">
<INPUT type=hidden name="tech_address3" value="{{tech_address3}}">
<INPUT type=hidden name="tech_city" value="{{tech_city}}">
<INPUT type=hidden name="tech_state" value="{{tech_state}}">
<INPUT type=hidden name="tech_country" value="{{tech_country}}">
<INPUT type=hidden name="tech_postal_code" value="{{tech_postal_code}}">
<INPUT type=hidden name="tech_phone" value="{{tech_phone}}">
<INPUT type=hidden name="tech_fax" value="{{tech_fax}}">
<INPUT type=hidden name="tech_email" value="{{tech_email}}">
<INPUT type=hidden name="p_cc_type" value="{{p_cc_type}}">
<INPUT type=hidden name="p_cc_num" value="{{p_cc_num}}">
<INPUT type=hidden name="p_cc_exp_mon" value="{{p_cc_exp_mon}}">
<INPUT type=hidden name="p_cc_exp_yr" value="{{p_cc_exp_yr}}">
<INPUT type=hidden name="fqdn1" value="{{fqdn1}}">
<INPUT type=hidden name="fqdn2" value="{{fqdn2}}">
<INPUT type=hidden name="fqdn3" value="{{fqdn3}}">
<INPUT type=hidden name="fqdn4" value="{{fqdn4}}">
<INPUT type=hidden name="fqdn5" value="{{fqdn5}}">
<INPUT type=hidden name="fqdn6" value="{{fqdn6}}">
<INPUT type=submit value=" << Back ">
<INPUT type=hidden name="action" value="{{action}}">
</FORM>
<!--End-->
TODO : "Same as " checkbox state must be handled. How ?
In order.html and verify.html add before </FORM> near end of file line
<INPUT type=hidden name="confirm_password" value="{{confirm_password}}">
If You need number of CC printed in field after return back from error
change in order.html
<TD align=left><input name="p_cc_num" size=20 value=""></TD>
to
<TD align=left><input name="p_cc_num" size=20 value="{{p_cc_num}}"></TD>
But here is one problem - how to save state of drop-down list ?
Visa must appear when visa was selected or MCard if MCard.
Same with expiry month, year and registration period. Needed to
add "selected" tag to correspondent <option> instead of hardcoded in
template. Any ideas ?
Last: Button "Change" in verify.html
Add following code AFTER existing </form> .
<FORM method=post action="{{CGI}}">
<font face="arial"><INPUT type=submit value="Change"></font>
<INPUT type=hidden name="affiliate_id" value="{{affiliate_id}}">
<INPUT type=hidden name="reg_username" value="{{reg_username}}">
<INPUT type=hidden name="reg_password" value="{{reg_password}}">
<INPUT type=hidden name="confirm_password" value="{{confirm_password}}">
<INPUT type=hidden name="reg_domain" value="{{reg_domain}}">
<INPUT type=hidden name="reg_type" value="{{reg_type}}">
<INPUT type=hidden name="bulk_order" value="{{bulk_order}}">
<INPUT type=hidden name="period" value="{{period}}">
{{domain_string}}
<input type=hidden name=period value="{{period}}">
<input type=hidden name=owner_first_name value="{{owner_first_name}}">
<input type=hidden name=owner_last_name value="{{owner_last_name}}">
<input type=hidden name=owner_org_name value="{{owner_org_name}}">
<input type=hidden name=owner_address1 value="{{owner_address1}}">
<input type=hidden name=owner_address2 value="{{owner_address2}}">
<input type=hidden name=owner_address3 value="{{owner_address3}}">
<input type=hidden name=owner_city value="{{owner_city}}">
<input type=hidden name=owner_state value="{{owner_state}}">
<input type=hidden name=owner_country value="{{owner_country}}">
<input type=hidden name=owner_postal_code value="{{owner_postal_code}}">
<input type=hidden name=owner_phone value="{{owner_phone}}">
<input type=hidden name=owner_fax value="{{owner_fax}}">
<input type=hidden name=owner_email value="{{owner_email}}">
<input type=hidden name=billing_first_name value="{{billing_first_name}}">
<input type=hidden name=billing_last_name value="{{billing_last_name}}">
<input type=hidden name=billing_org_name value="{{billing_org_name}}">
<input type=hidden name=billing_address1 value="{{billing_address1}}">
<input type=hidden name=billing_address2 value="{{billing_address2}}">
<input type=hidden name=billing_address3 value="{{billing_address3}}">
<input type=hidden name=billing_city value="{{billing_city}}">
<input type=hidden name=billing_state value="{{billing_state}}">
<input type=hidden name=billing_country value="{{billing_country}}">
<input type=hidden name=billing_postal_code value="{{billing_postal_code}}">
<input type=hidden name=billing_phone value="{{billing_phone}}">
<input type=hidden name=billing_fax value="{{billing_fax}}">
<input type=hidden name=billing_email value="{{billing_email}}">
<input type=hidden name=tech_first_name value="{{tech_first_name}}">
<input type=hidden name=tech_last_name value="{{tech_last_name}}">
<input type=hidden name=tech_org_name value="{{tech_org_name}}">
<input type=hidden name=tech_address1 value="{{tech_address1}}">
<input type=hidden name=tech_address2 value="{{tech_address2}}">
<input type=hidden name=tech_address3 value="{{tech_address3}}">
<input type=hidden name=tech_city value="{{tech_city}}">
<input type=hidden name=tech_state value="{{tech_state}}">
<input type=hidden name=tech_country value="{{tech_country}}">
<input type=hidden name=tech_postal_code value="{{tech_postal_code}}">
<input type=hidden name=tech_phone value="{{tech_phone}}">
<input type=hidden name=tech_fax value="{{tech_fax}}">
<input type=hidden name=tech_email value="{{tech_email}}">
{{NAMESERVER_INFO}}
{{BILLING_INFO}}
<INPUT type=hidden name="action" value="do_setup_profile">
</FORM>
After that there must be TWO different forms with
one button in each. Same question about drop-down lists.
About that stupid <br> in second address field after return.
To remove it just kill in reg_system.cgi in sub verify_order following lines
and add <br> to template.
# make the display of this data look a little better
if ($HTML{owner_address2}) { $HTML{owner_address2} .= "<br>\n" }
if ($HTML{owner_address3}) { $HTML{owner_address3} .= "<br>\n" }
if ($HTML{billing_address2}) { $HTML{billing_address2} .= "<br>\n" }
if ($HTML{billing_address3}) { $HTML{billing_address3} .= "<br>\n" }
They are useless anyway. Or add new variables with <br> inside if
you can't live without them. IMHO trashing variables with <br> was really
not good idea from OpenSRS perlgrammer.
OK. Thas all. I've tryed all exactly as described above at clean system
(without internet connection but with some emulation of actual server
answers) and it work. Hope at your will work too. And hope you could
understand my strange language which i call English ;)
Regards
Sergie