X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fcontact.html;h=feb61db8d097e2c3b4b938838d7f73704d720c6d;hb=5fa9ce1b7c8b934e96a6a2f850a4e788eb76f495;hp=21c6b299096e618b05d34a4b5e42fd9d8b9b69dc;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git
diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html
index 21c6b2990..feb61db8d 100644
--- a/httemplate/edit/cust_main/contact.html
+++ b/httemplate/edit/cust_main/contact.html
@@ -3,8 +3,8 @@
<%$r%>Contact name (last, first) |
- > ,
- >
+ <%$style%>> ,
+ <%$style%>>
|
% if ( $conf->exists('show_ss') && !$pre ) {
@@ -21,74 +21,40 @@
Company |
- >
+ <%$style%>>
|
-
- <%$r%>Address |
-
- >
- |
-
-
-% my $address2_label_style =
-% ( $disabled
-% || ! $conf->exists('cust_main-require_address2')
-% || ( !$pre && !$opt{'same_checked'} )
-% )
-% ? 'visibility:hidden'
-% : '';
-
-
- * Unit # |
-
- >
- |
-
-
-
- <%$r%>City |
-
- >
- |
- ><%$r%>County |
-
- <% include('select-county.html', %select_hash ) %>
- |
- <%$r%>State |
-
- <% include('select-state.html', %select_hash ) %>
- |
- <%$r%>Zip |
-
- >
- |
-
-
-
- <%$r%>Country |
- <% include('select-country.html', %select_hash ) %> |
-
+<% include('/elements/location.html',
+ 'prefix' => $pre,
+ 'object' => $cust_main,
+ 'onchange' => $onchange,
+ 'disabled' => $disabled,
+ 'style' => \@style,
+ 'same_checked' => $opt{'same_checked'},
+ 'geocode' => $opt{'geocode'},
+ 'censustract' => $opt{'censustract'},
+ )
+%>
<% $daytime_label %> |
- >
+ <%$style%>>
|
<% $night_label %> |
- >
+ <%$style%>>
|
Fax |
- >
+ <%$style%>>
|
@@ -96,13 +62,18 @@
<% $stateid_label %> |
- > |
+ <%$style%>> |
<% $stateid_state_label %> |
- <% include('select-state.html', 'state' => $cust_main->stateid_state,
- 'country' => $cust_main->country,
- 'prefix' => 'stateid_',
- 'onchange' => $onchange,
- 'disabled' => $disabled) %> |
+ <% include('/elements/select-state.html',
+ 'state' => $cust_main->stateid_state,
+ 'country' => $cust_main->country,
+ 'prefix' => 'stateid_',
+ 'onchange' => $onchange,
+ 'disabled' => $disabled,
+ 'style' => \@style,
+ )
+ %>
+ |
% } elsif ( !$pre ) {
@@ -121,6 +92,10 @@ my $cust_main = $opt{'cust_main'};
my $pre = $opt{'pre'};
my $onchange = $opt{'onchange'};
my $disabled = $opt{'disabled'};
+my @style = ( $opt{'style'} ? @{ $opt{'style'} } : () );
+
+#push @style, 'background-color: #dddddd' if $disabled;
+my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
my $conf = new FS::Conf;
@@ -142,6 +117,12 @@ $cust_main->set($pre.'state', $statedefault )
$cust_main->set('stateid_state', $cust_main->state )
unless $pre || $cust_main->get('stateid_state');
+$opt{geocode} ||= $cust_main->get('geocode');
+
+if ( $conf->exists('cust_main-require_censustract') ) {
+ $opt{censustract} ||= $cust_main->censustract;
+}
+
#my($county_html, $state_html, $country_html) =
# FS::cust_main_county::regionselector( $cust_main->get($pre.'county'),
# $cust_main->get($pre.'state'),
@@ -151,20 +132,6 @@ $cust_main->set('stateid_state', $cust_main->state )
# $disabled,
# );
-my %select_hash = (
- 'county' => $cust_main->get($pre.'county'),
- 'state' => $cust_main->get($pre.'state'),
- 'country' => $cust_main->get($pre.'country'),
- 'prefix' => $pre,
- 'onchange' => $onchange,
- 'disabled' => $disabled,
-);
-
-my @counties = counties( $cust_main->get($pre.'state'),
- $cust_main->get($pre.'country'),
- );
-my $county_style = scalar(@counties) > 1 ? '' : 'STYLE="visibility:hidden"';
-
my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
? 'Day Phone'
: FS::Msgcat::_gettext('daytime');