From 37314c736907de968d3f61dd5dc93aa61c6ca161 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 13 Mar 2011 02:31:10 +0000 Subject: qualification address handling changes, RT#7111 --- httemplate/elements/location.html | 151 +++++++++++++++++++++++++++----------- 1 file changed, 108 insertions(+), 43 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index b5f76409b..5304c37d6 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -17,6 +17,27 @@ Example: +% if ( $opt{'alt_format'} ) { + + + <<%$th%> ALIGN="right">Locatiopn 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'), + ) + %> + + + +% } + <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %>> @@ -31,61 +52,105 @@ Example: > + +% if ( ! $opt{'alt_format'} ) { #regular format + >* >Unit # - - <% $style %> - > + + <% $style %> + > +% } else { # alternate format + + -% if ( $opt{'alt_format'} ) { - <<%$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'), - ) - %> + <<%$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) %> -- cgit v1.2.1