X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fcontact.html;h=d93d41728d4c729084170cf6aaadf8953b01e362;hb=d8cb6cd67cc574c90dbbfbd8db2da6711c516d65;hp=e813986cdb4c1f2bf48e87fa6c7d240c10a5ac86;hpb=3c8870ee619416f126a65c93d5ef7a2f2e24bc96;p=freeside.git diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index e813986cd..d93d41728 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -9,10 +9,10 @@ % if ( $conf->exists('show_ss') && !$pre ) { SS# - + % } elsif ( !$pre ) { - + % } @@ -32,8 +32,16 @@ +% my $address2_label_style = +% ( $disabled +% || ! $conf->exists('cust_main-require_address2') +% || ( !$pre && !$opt{'same_checked'} ) +% ) +% ? 'visibility:hidden' +% : ''; + -   + * Unit # > @@ -46,11 +54,11 @@ ><%$r%>County - <% include('select-county.html', %select_hash ) %> + <% include('/elements/select-county.html', %select_hash ) %> <%$r%>State - <% include('select-state.html', %select_hash ) %> + <% include('/elements/select-state.html', %select_hash ) %> <%$r%>Zip @@ -60,7 +68,11 @@ <%$r%>Country - <% include('select-country.html', %select_hash ) %> + <% include('/elements/select-country.html', %select_hash ) %> +% if ( !$pre ) { + +% } + @@ -84,14 +96,46 @@ +% if ( $conf->exists('show_stateid') && !$pre ) { + + + <% $stateid_label %> + > + <% $stateid_state_label %> + <% include('/elements/select-state.html', + 'state' => $cust_main->stateid_state, + 'country' => $cust_main->country, + 'prefix' => 'stateid_', + 'onchange' => $onchange, + 'disabled' => $disabled, + ) + %> + + +% } elsif ( !$pre ) { + + + +% } + <%$r%>required fields
<%init> -my( $cust_main, $pre, $onchange, $disabled ) = @_; +#my( $cust_main, $pre, $onchange, $disabled, %opt ) = @_; +my %opt = @_; +my $cust_main = $opt{'cust_main'}; +my $pre = $opt{'pre'}; +my $onchange = $opt{'onchange'}; +my $disabled = $opt{'disabled'}; + my $conf = new FS::Conf; +foreach (qw(ss stateid)) { + $opt{$_} = $cust_main->masked($_) unless exists $opt{$_}; +} + #false laziness with ship state my $countrydefault = $conf->config('countrydefault') || 'US'; $cust_main->set($pre.'country', $countrydefault ) @@ -103,6 +147,9 @@ $cust_main->set($pre.'state', $statedefault ) unless $cust_main->get($pre.'state') || $cust_main->get($pre.'country') ne $countrydefault; +$cust_main->set('stateid_state', $cust_main->state ) + unless $pre || $cust_main->get('stateid_state'); + #my($county_html, $state_html, $country_html) = # FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), # $cust_main->get($pre.'state'), @@ -126,8 +173,18 @@ my @counties = counties( $cust_main->get($pre.'state'), ); my $county_style = scalar(@counties) > 1 ? '' : 'STYLE="visibility:hidden"'; -my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; -my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; +my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ + ? 'Day Phone' + : FS::Msgcat::_gettext('daytime'); +my $night_label = FS::Msgcat::_gettext('night') =~/^(night)?$/ + ? 'Night Phone' + : FS::Msgcat::_gettext('night') || 'Night Phone'; +my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/ + ? 'Driver’s License' + : FS::Msgcat::_gettext('stateid') || 'Driver’s License'; +my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/ + ? 'Driver’s License State' + : FS::Msgcat::_gettext('stateid_state') || 'Driver’s License State'; my $r = qq!* !;