projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
have the UI use full country names, and state names outside the US...
[freeside.git]
/
httemplate
/
edit
/
cust_main
/
select-country.html
diff --git
a/httemplate/edit/cust_main/select-country.html
b/httemplate/edit/cust_main/select-country.html
index
014effd
..
3941f2f
100644
(file)
--- a/
httemplate/edit/cust_main/select-country.html
+++ b/
httemplate/edit/cust_main/select-country.html
@@
-26,7
+26,7
@@
function <%= $opt{'prefix'} %>country_changed(what, callback) {
function <%= $opt{'prefix'} %>country_changed(what, callback) {
- country = what.options[what.selectedIndex].
text
;
+ country = what.options[what.selectedIndex].
value
;
function <%= $opt{'prefix'} %>update_states(states) {
function <%= $opt{'prefix'} %>update_states(states) {
@@
-36,8
+36,8
@@
// add the new states
var statesArray = eval('(' + states + ')' );
// add the new states
var statesArray = eval('(' + states + ')' );
- for ( var s = 0; s < statesArray.length; s
++
) {
- var stateLabel = statesArray[s];
+ for ( var s = 0; s < statesArray.length; s
=s+2
) {
+ var stateLabel = statesArray[s
+1
];
if ( stateLabel == "" )
stateLabel = '(n/a)';
opt(what.form.<%= $opt{'prefix'} %>state, statesArray[s], stateLabel);
if ( stateLabel == "" )
stateLabel = '(n/a)';
opt(what.form.<%= $opt{'prefix'} %>state, statesArray[s], stateLabel);
@@
-58,13
+58,14
@@
<SELECT NAME="<%= $opt{'prefix'} %>country" onChange="<%= $opt{'prefix'} %>country_changed(this); <%= $opt{'onchange'} %>" <%= $opt{'disabled'} %>>
<% foreach my $country (
<SELECT NAME="<%= $opt{'prefix'} %>country" onChange="<%= $opt{'prefix'} %>country_changed(this); <%= $opt{'onchange'} %>" <%= $opt{'disabled'} %>>
<% foreach my $country (
- sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) or $a cmp $b }
+ sort { ($b eq $countrydefault) <=> ($a eq $countrydefault)
+ or code2country($a) cmp code2country($b) }
map { $_->country }
qsearch( 'cust_main_county',{}, 'DISTINCT ON ( country ) *', )
) {
%>
map { $_->country }
qsearch( 'cust_main_county',{}, 'DISTINCT ON ( country ) *', )
) {
%>
- <OPTION VALUE="<%= $country %>"<%= $country eq $opt{'country'} ? ' SELECTED' : '' %>><%=
$country
%>
+ <OPTION VALUE="<%= $country %>"<%= $country eq $opt{'country'} ? ' SELECTED' : '' %>><%=
code2country($country). " ($country)"
%>
<% } %>
<% } %>