fix SelfService county selector, RT#8079
authormark <mark>
Tue, 17 Aug 2010 01:05:46 +0000 (01:05 +0000)
committermark <mark>
Tue, 17 Aug 2010 01:05:46 +0000 (01:05 +0000)
fs_selfservice/FS-SelfService/SelfService.pm
fs_selfservice/FS-SelfService/cgi/signup.html

index 7e6821b..a0e632c 100644 (file)
@@ -1393,6 +1393,18 @@ END
   my $county_html = $script_html;
   if ( $countyflag ) {
     $county_html .= qq!<SELECT NAME="${prefix}county" onChange="$param->{'onchange'}">!;
+    foreach my $county ( 
+      sort keys %{ $cust_main_county{$param->{'selected_country'}}{$param->{'selected_state'}} }
+    ) {
+      my $text = $county || '(n/a)';
+      $county_html .= qq!<OPTION VALUE="$county"!.
+                      ($county eq $param->{'selected_county'} ? 
+                        ' SELECTED>' : 
+                        '>'
+                      ).
+                      $text.
+                      '</OPTION>';
+    }
     $county_html .= '</SELECT>';
   } else {
     $county_html .=
index 375137b..7a56a31 100755 (executable)
@@ -74,8 +74,6 @@ Contact Information
 <TR>
   <TH ALIGN="right"><font color="#ff0000">*</font>City</TH>
   <TD><INPUT TYPE="text" NAME="city" VALUE="<%= $city %>"></TD>
-  <TH ALIGN="right"><font color="#ff0000">*</font>State/Country</TH>
-  <TD>
     <%=
         ($county_html, $state_html, $country_html) =
           regionselector( {
@@ -87,8 +85,11 @@ Contact Information
             locales          => \@cust_main_county,
           } );
  
-        "$county_html $state_html";
     %>
+  <TH ALIGN="right"><font color="#ff0000">*</font>
+    <%= ($county_html =~ /SELECT/) ? 'County/State' : 'State' %></TH>
+  <TD>
+    <%= "$county_html $state_html"; %>
   </TD>
   <TH><font color="#ff0000">*</font>Zip</TH>
   <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="<%= $zip %>"></TD>