add location to svc_phone, RT#7047
[freeside.git] / httemplate / elements / location.html
index f21b8ad..4750b68 100644 (file)
@@ -3,26 +3,28 @@
 Example:
 
   include( '/elements/location.html',
-             'object'       => $cust_main,  # or $cust_location
-             'prefix'       => $pre,        #only for cust_main objects
-             'onchange'     => $javascript,
-             'disabled'     => $disabled,
-             'same_checked' => $same_checked,
-             'geocode'      => $geocode, #passed through
-             'no_asterisks' => 0, #set true to disable the red asterisks next
-                                  #to required fields
+             'object'         => $cust_main,  # or $cust_location
+             'prefix'         => $pre,        #only for cust_main objects
+             'onchange'       => $javascript,
+             '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
          )
 
 </%doc>
 
 <TR>
-  <TH ALIGN="right"><%$r%>Address</TH>
+  <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></<%$th%>>
   <TD COLSPAN=7>
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>address1"
            ID       = "<%$pre%>address1"
            VALUE    = "<% $object->get($pre.'address1') |h %>"
-           SIZE     = 70
+           SIZE     = 54
            onChange = "<% $onchange %>"
            <% $disabled %>
            <% $style %>
@@ -31,13 +33,13 @@ Example:
 </TR>
 
 <TR>
-  <TD ALIGN="right"><FONT ID="<% $pre %>address2_required" color="#ff0000" STYLE="<% $address2_label_style %>">*</FONT>&nbsp;<FONT ID="<% $pre %>address2_label" STYLE="<% $address2_label_style %>"><B>Unit&nbsp;#</B></FONT></TD>
+  <TD ALIGN="right"><FONT ID="<% $pre %>address2_required" color="#ff0000" <% $address2_label_style %>>*</FONT>&nbsp;<FONT ID="<% $pre %>address2_label" <% $address2_label_style %>><B>Unit&nbsp;#</B></FONT></TD>
   <TD COLSPAN=7>
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>address2"
            ID       = "<%$pre%>address2"
            VALUE    = "<% $object->get($pre.'address2') |h %>"
-           SIZE     = 70
+           SIZE     = 54
            onChange = "<% $onchange %>"
            <% $disabled %>
            <% $style %>
@@ -46,8 +48,8 @@ Example:
 </TR>
 
 <TR>
-  <TH ALIGN="right"><%$r%>City</TH>
-  <TD>
+  <<%$th%> ALIGN="right"><%$r%>City</<%$th%>>
+  <TD WIDTH="1">
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>city"
            ID       = "<%$pre%>city"
@@ -57,15 +59,13 @@ Example:
            <% $style %>
     >
   </TD>
-  <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
-  <TD>
-    <% include('/elements/select-county.html', %select_hash ) %>
-  </TD>
-  <TH ALIGN="right"><%$r%>State</TH>
-  <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%>>
+  <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"
@@ -80,12 +80,22 @@ Example:
 </TR>
 
 <TR>
-  <TH ALIGN="right"><%$r%>Country</TH>
-  <TD COLSPAN=5><% include('/elements/select-country.html', %select_hash ) %></TD>
+  <<%$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>
@@ -125,7 +135,7 @@ my @counties = counties( $object->get($pre.'state'),
                          $object->get($pre.'country'),
                        );
 my @county_style = ();
-push @county_style, 'visibility:hidden'
+push @county_style, 'display:none' # 'visibility:hidden'
   unless scalar(@counties) > 1;
 
 my $style =
@@ -151,4 +161,6 @@ my %select_hash = (
   'style'    => \@style,
 );
 
+my $th = $opt{'no_bold'} ? 'TD' : 'TH';
+
 </%init>