communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[freeside.git] / httemplate / elements / location.html
index dbc567d..0d2fa38 100644 (file)
@@ -9,6 +9,7 @@ Example:
              'disabled'       => $disabled,
              'same_checked'   => $same_checked,
              'geocode'        => $geocode, #passed through
+             'censustract'    => $censustract, #passed through
              'no_asterisks'   => 0, #set true to disable the red asterisks next
                                     #to required fields
              'address1_label' => 'Address', #label for address
@@ -17,7 +18,7 @@ Example:
 </%doc>
 
 <TR>
-  <TH ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></TH>
+  <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></<%$th%>>
   <TD COLSPAN=7>
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>address1"
@@ -47,24 +48,15 @@ Example:
 </TR>
 
 <TR>
-  <TH ALIGN="right"><%$r%>City</TH>
-  <TD WIDTH="1">
-    <INPUT TYPE     = "text"
-           NAME     = "<%$pre%>city"
-           ID       = "<%$pre%>city"
-           VALUE    = "<% $object->get($pre.'city') |h %>"
-           onChange = "<% $onchange %>"
-           <% $disabled %>
-           <% $style %>
-    >
-  </TD>
-  <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
+  <<%$th%> ALIGN="right"><%$r%>City</<%$th%>>
+  <TD WIDTH="1"><% include('/elements/city.html', %select_hash) %></TD>
+  <<%$th%> ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</<%$th%>>
   <TD><% include('/elements/select-county.html', %select_hash ) %></TD>
-  <TH ALIGN="right" WIDTH="1"><%$r%>State</TH>
+  <<%$th%> ALIGN="right" WIDTH="1"><%$r%>State</<%$th%>>
   <TD WIDTH="1">
     <% include('/elements/select-state.html', %select_hash ) %>
   </TD>
-  <TH><%$r%>Zip</TH>
+  <<%$th%>><%$r%>Zip</<%$th%>>
   <TD>
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>zip"
@@ -79,12 +71,22 @@ Example:
 </TR>
 
 <TR>
-  <TH ALIGN="right"><%$r%>Country</TH>
+  <<%$th%> ALIGN="right"><%$r%>Country</<%$th%>>
   <TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD>
 </TR>
 
 % if ( !$pre ) { 
   <INPUT TYPE="hidden" NAME="geocode" VALUE="<% $opt{geocode} %>">
+% } else {
+%   if ( $pre eq 'ship_' && $conf->exists('cust_main-require_censustract') ) {
+      <TR><<%$th%> ALIGN="right">Census tract<BR>(automatic)</<%$th%>>
+        <TD>
+          <INPUT TYPE="text" NAME="censustract" VALUE="<% $opt{censustract} %>">
+        </TD>
+      </TR>
+%   } else {
+      <INPUT TYPE="hidden" NAME="censustract" VALUE="<% $opt{censustract} %>">
+%   } 
 % } 
 
 <%init>
@@ -112,7 +114,7 @@ $object->set($pre.'state', $statedefault )
          || $object->get($pre.'country') ne $countrydefault;
 
 my @style = ();
-push @style, 'background-color: #dddddd"' if $disabled;
+push @style, 'background-color: #dddddd' if $disabled;
 
 my @address2_label_style = ();
 push @address2_label_style, 'visibility:hidden'
@@ -141,6 +143,7 @@ my $county_style =
     : '';
 
 my %select_hash = (
+  'city'     => $object->get($pre.'city'),
   'county'   => $object->get($pre.'county'),
   'state'    => $object->get($pre.'state'),
   'country'  => $object->get($pre.'country'),
@@ -150,4 +153,6 @@ my %select_hash = (
   'style'    => \@style,
 );
 
+my $th = $opt{'no_bold'} ? 'TD' : 'TH';
+
 </%init>