summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/tr-censustract.html23
-rw-r--r--httemplate/elements/tr-select-cust_location.html9
2 files changed, 32 insertions, 0 deletions
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) {
+<TR>
+ <TD ALIGN="right"><% mt('Census tract') |h %></TD>
+ <TD COLSPAN=5>
+ <SPAN STYLE="background-color: #ffffff; border: 1px solid #ffffff"><% $censustract |h %></SPAN>
+ &nbsp;<% $censusyear |h %>
+ </TD>
+</TR>
+% }
+<%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 = '';
+}
+
+</%init>
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 ) {