X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Flocation.html;h=b5f76409bbfdeaffe5af126322f5d2f7b2b2fadb;hb=f7e5e7625b04164ce2e0aac77a85bc03a7d48a6f;hp=bf340894ae2eb4bb2b31960f58129ff0f7ac14f3;hpb=20bddf47a41b6d064b3cfa4c41e55c157cf0c3de;p=freeside.git diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index bf340894a..b5f76409b 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -3,69 +3,103 @@ 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 ) - <%$r%>Address + <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %>> <% $style %> > + + >* >Unit # + + + <% $style %> + > + + + +% if ( $opt{'alt_format'} ) { - * Unit # - - - <% $style %> - > - + <<%$th%> ALIGN="right">Location Type> + + <% $style %> + > + + + <<%$th%> ALIGN="right">Number> + + <% $style %> + > + + <<%$th%> ALIGN="right">Kind> + + <% include('/elements/select.html', + 'cgi' => $cgi, + 'field' => 'location_kind', + 'disabled' => $disabled, + 'style' => $style, + 'options' => \@location_kind_options, + 'labels' => $location_kind_labels, + 'curr_value' => $cgi->param('location_kind'), + ) + %> + +% } - <%$r%>City - - - <% $style %> - > - - ><%$r%>County - - <% include('/elements/select-county.html', %select_hash ) %> - - <%$r%>State - + <<%$th%> ALIGN="right"><%$r%>City> + <% include('/elements/city.html', %select_hash) %> + <<%$th%> ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County> + <% include('/elements/select-county.html', %select_hash ) %> + <<%$th%> ALIGN="right" WIDTH="1"><%$r%>State> + <% include('/elements/select-state.html', %select_hash ) %> - <%$r%>Zip + <<%$th%>><%$r%>Zip> - <%$r%>Country - <% include('/elements/select-country.html', %select_hash ) %> + <<%$th%> ALIGN="right"><%$r%>Country> + <% include('/elements/select-country.html', %select_hash ) %> % if ( !$pre ) { +% } else { +% if ( $pre eq 'ship_' && $conf->exists('cust_main-require_censustract') ) { + <<%$th%> ALIGN="right">Census tract
(automatic)> + + + + +% } else { + +% } % } <%init> @@ -109,7 +153,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' @@ -121,7 +165,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 = @@ -138,6 +182,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'), @@ -147,4 +192,9 @@ my %select_hash = ( 'style' => \@style, ); +my $th = $opt{'no_bold'} ? 'TD' : 'TH'; + +my @location_kind_options = ( '', 'R', 'B' ); +my $location_kind_labels = { '' => '', 'R' => 'Residential', 'B' => 'Business' }; +