From 663b89d06a2c97fb0e7915ba409310fbefefea98 Mon Sep 17 00:00:00 2001 From: levinse Date: Mon, 6 Dec 2010 06:36:02 +0000 Subject: -tr-select-cust_location.html and elements/location.html: optionally support alternate address format and optional address -nearly finished qualifications, RT7111 --- httemplate/elements/location.html | 66 +++++++++++++++++++----- httemplate/elements/tr-select-cust_location.html | 36 ++++++++----- 2 files changed, 78 insertions(+), 24 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index 0d2fa38c3..b5f76409b 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -31,21 +31,60 @@ Example: > + + >* >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'), + ) + %> + +% } <<%$th%> ALIGN="right"><%$r%>City> @@ -155,4 +194,7 @@ my %select_hash = ( my $th = $opt{'no_bold'} ? 'TD' : 'TH'; +my @location_kind_options = ( '', 'R', 'B' ); +my $location_kind_labels = { '' => '', 'R' => 'Residential', 'B' => 'Business' }; + diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index f2b267a8b..78252ba1d 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -25,18 +25,26 @@ Example: function locationnum_changed(what) { var locationnum = what.options[what.selectedIndex].value; + if ( locationnum == -2 ) { +% for (@location_fields, 'city_select') { + what.form.<%$_%>.disabled = true; + var ftype = what.form.<%$_%>.tagName; + if( ftype == 'SELECT') changeSelect(what.form.<%$_%>, ''); + else what.form.<%$_%>.value = ''; + what.form.<%$_%>.style.backgroundColor = '#dddddd'; +% } + return; + } + if ( locationnum == -1 ) { % for (@location_fields, 'city_select') { what.form.<%$_%>.disabled = false; what.form.<%$_%>.style.backgroundColor = '#ffffff'; + var ftype = what.form.<%$_%>.tagName; + if( ftype == 'INPUT' ) what.form.<%$_%>.value = ''; % } - what.form.address1.value = ''; - what.form.address2.value = ''; - what.form.city.value = ''; - what.form.zip.value = ''; - changeSelect(what.form.country, <% $countrydefault |js_string %>); country_changed( what.form.country, @@ -147,6 +155,9 @@ Example: