From b286638fd4cb875178b0247a04b2706a44cadf6f Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 7 Nov 2013 20:05:34 -0800 Subject: show census tracts for all customer and package locations, #25726 --- httemplate/elements/tr-censustract.html | 23 +++++++++++++++++++++++ httemplate/elements/tr-select-cust_location.html | 9 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 httemplate/elements/tr-censustract.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-censustract.html b/httemplate/elements/tr-censustract.html new file mode 100644 index 000000000..bd014f11b --- /dev/null +++ b/httemplate/elements/tr-censustract.html @@ -0,0 +1,23 @@ +% if ($censustract) { + + <% mt('Census tract') |h %> + + <% $censustract |h %> +  <% $censusyear |h %> + + +% } +<%init> + +my $location = shift; +my $conf = FS::Conf->new; +my ($censustract, $censusyear); +if ($location->censustract) { + $censustract = $location->censustract; + $censusyear = '('. ($location->censusyear || mt('unknown year')) . ')'; +} elsif ($conf->exists('cust_main-require_censustract')) { + $censustract = mt('unknown'); + $censusyear = ''; +} + + diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index e1fa825c1..4ed9cd48e 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -31,6 +31,9 @@ Example: else what.form.<%$_%>.value = ''; if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#dddddd'; % } + if(what.form.enter_censustract) { + what.form.enter_censustract.disabled = true; + } } function location_clear(what) { @@ -38,6 +41,9 @@ Example: var ftype = what.form.<%$_%>.tagName; if( ftype == 'INPUT' ) what.form.<%$_%>.value = ''; % } + if(what.form.enter_censustract) { + what.form.enter_censustract.value = ''; + } % if ( $opt{'alt_format'} ) { changeSelect(what.form.location_kind, ''); changeSelect(what.form.location_type, ''); @@ -51,6 +57,9 @@ Example: var ftype = what.form.<%$_%>.tagName; if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#ffffff'; % } + if(what.form.enter_censustract) { + what.form.enter_censustract.disabled = false; + } % if ( $opt{'alt_format'} ) { if ( what.form.location_type && what.form.location_type.options[what.form.location_type.selectedIndex].value ) { -- cgit v1.2.1