X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Flocation.html;h=39e7041c72be197e6fe7a5f13396d7a52e108268;hb=33c25a7514cb1f4ba56fc320dc43159c3cfae610;hp=5478e1e1e94f0a51be1f4dfc0e503c5bbce01092;hpb=0b94e40c533288be69a4fe60da36a385d31eff7f;p=freeside.git diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index 5478e1e1e..39e7041c7 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -17,8 +17,29 @@ Example: +% if ( $opt{'alt_format'} ) { + + + <<%$th%> ALIGN="right">Location type> + + <% include('/elements/select.html', + 'cgi' => $cgi, + 'field' => 'location_kind', + 'disabled' => $disabled, + 'style' => $style, + 'options' => \@location_kind_options, + 'labels' => $location_kind_labels, + 'curr_value' => scalar($cgi->param('location_kind')) + || $object->get($pre.'location_kind'), + ) + %> + + + +% } + - <%$r%><% $opt{'address1_label'} || 'Address' %> + <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %>> +% if ( ! $opt{'alt_format'} ) { #regular format + - >* >Unit # - - - <% $style %> - > - + >* >Unit # + + + <% $style %> + > + +% } else { # alternate format + + + - <%$r%>City + <<%$th%> ALIGN="right">Unit Type and #> + + +% my $location_type = scalar($cgi->param('location_type')) +% || $object->get($pre.'location_type'); +% #my $location_number = scalar($cgi->param('location_number')) +% # || $object->get($pre.'location_number'); +% +% if ( $object->get($pre.'address2') && ! $location_type ) { +% } +% +% if ( 1 ) { #ikano, switch on via config +% tie my %location_types, 'Tie::IxHash', +% FS::part_export::ikano->location_types; + <% include('/elements/select.html', + 'cgi' => $cgi, + 'field' => 'location_type', + 'disabled' => $disabled, + 'style' => $style, + 'options' => [ keys %location_types ], + 'labels' => \%location_types, + 'curr_value' => $location_type, + 'onchange' => 'location_type_changed', + ) + %> + +% } else { + + <% $style %> + > +% } + + + <% $style %> + > + +% if ( $object->get($pre.'address2') ) { + +% #XXX try to parse first +% if ( 0 ) { +% } else { + Can't parse unit type and number from <% $object->get($pre.'address2') |h %> +% } + +% } + + + + + +% } + + + + <<%$th%> ALIGN="right"><%$r%>City> <% include('/elements/city.html', %select_hash) %> - ><%$r%>County + <<%$th%> ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County> <% include('/elements/select-county.html', %select_hash ) %> - <%$r%>State + <<%$th%> ALIGN="right" WIDTH="1"><%$r%>State> <% include('/elements/select-state.html', %select_hash ) %> - <%$r%>Zip + <<%$th%>><%$r%>Zip> - <%$r%>Country + <<%$th%> ALIGN="right"><%$r%>Country> <% include('/elements/select-country.html', %select_hash ) %> @@ -79,7 +183,7 @@ Example: % } else { % if ( $pre eq 'ship_' && $conf->exists('cust_main-require_censustract') ) { - Census tract
(automatic) + <<%$th%> ALIGN="right">Census tract
(automatic)> @@ -153,4 +257,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' }; +