X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Flocation.html;h=e93553e2af869fb2107f754ecc8598f6d29de4a2;hb=080406e219b6c63d02bfda8abea33020c4265db1;hp=b5f76409bbfdeaffe5af126322f5d2f7b2b2fadb;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index b5f76409b..e93553e2a 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -17,6 +17,28 @@ Example: +% if ( $opt{'alt_format'} ) { + + + <<%$th%> ALIGN="right">Location kind> + + <% include('/elements/select.html', + 'cgi' => $cgi, + 'field' => 'location_kind', + 'id' => '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 +53,106 @@ 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', + 'id' => '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) %>