X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fcontact.html;h=57490b962526568b6f82f911197da2065ba5db22;hb=9b4209f91ad9e3c4cef7deebfb0180f6faf1d0dc;hp=d3b7b167fea476a1c3e477e0df3bf917edbf9bc1;hpb=2b49cbe76b94c6c1561aa2bf37beba7d47591190;p=freeside.git diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index d3b7b167f..57490b962 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -1,113 +1,202 @@ -<% + -my( $cust_main, $pre, $onchange, $disabled ) = @_; -my $conf = new FS::Conf; - -#false laziness with ship state -my $countrydefault = $conf->config('countrydefault') || 'US'; -$cust_main->set($pre.'country', $countrydefault ) - unless $cust_main->get($pre.'country'); + + + +% if ( $conf->exists('show_ss') && !$pre ) { -my $statedefault = $conf->config('statedefault') - || ($countrydefault eq 'US' ? 'CA' : ''); -$cust_main->set($pre.'state', $statedefault ) - unless $cust_main->get($pre.'state') - || $cust_main->get($pre.'country') ne $countrydefault; + + +% } elsif ( !$pre ) { -my($county_html, $state_html, $country_html) = - FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), - $cust_main->get($pre.'state'), - $cust_main->get($pre.'country'), - $pre, - $onchange, - $disabled, - ); + +% } + -my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; -my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; +% if ( $conf->exists('cust-email-high-visibility') && !$pre ) { + + + + +% } -my $r = qq!* !; +% unless ( $conf->exists('cust-edit-alt-field-order') ) { #standard order -%> + <& company &> + <& location &> + <& phones &> + <& fax &> -<%= &ntable("#cccccc") %> +% } else { #alternate field order - - - + <& phones &> + <& location &> + <& fax &> + <& company &> -<% if ( $conf->exists('show_ss') && !$pre ) { %> - - -<% } elsif ( !$pre ) { %> - -<% } %> +% } - +% if ( $conf->exists('show_stateid') && !$pre ) { - - + + + +% } elsif ( !$pre ) { - - - - + + +% } - - - - +
<%$r%><% mt('Contact name (last, first)') |h %> + <%$style%>> , + <%$style%>> + <% mt('SS#') |h %>
+ <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) + ? $r : '' %>Email address(es) + + +
<%=$r%>Contact name
(last, first)
- > , - > - SS#
Company - > + <% $stateid_label %> <%$style%>><% $stateid_state_label %><& /elements/select-state.html, + 'state' => $cust_main->stateid_state, + 'country' => $cust_main->country, + 'prefix' => 'stateid_', + 'onchange' => $onchange, + 'disabled' => $disabled, + 'style' => \@style, + &>
<%=$r%>Address - > -
  - > -
+<%$r%><% mt('required fields') |h %>
+ +<%def company> +% my $display = ($cust_main->residential_commercial eq 'Commercial') +% ? '' : 'none'; + + <% mt('Company') |h %> + + <%$style%>> + + + + +<%def location> + <& /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'}, + &> + + +<%def phones> + + <% mt('Phones') %> + + + + + + + + + + +
+ <%$style%>> +
<% $daytime_label %> +
  + <%$style%>> +
<% $night_label %> +
  + <%$style%>> +
<% $mobile_label %> +
+ + + + +<%def fax> + + <% mt('Fax') |h %> + + <%$style%>> + + + + +<%once> - - <%=$r%>City - - > - - <%=$r%>State - <%= $county_html. $state_html %> - <%=$r%>Zip - - > - - +my $r = qq!* !; - - <%=$r%>Country - <%= $country_html %> - + +<%shared> - - <%= $daytime_label %> - - > - - +my( %opt, $cust_main, $pre, $onchange, $disabled, @style, $style, + $daytime_label, $night_label, $mobile_label, + ); - - <%= $night_label %> - - > - - + +<%init> - - Fax - - > - - +%opt = @_; +$cust_main = $opt{'cust_main'}; +$pre = $opt{'pre'}; +$onchange = $opt{'onchange'}; +$disabled = $opt{'disabled'}; +@style = ( $opt{'style'} ? @{ $opt{'style'} } : () ); - -<%=$r%>required fields
+$style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; + +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 ) + unless $cust_main->get($pre.'country'); + +my $statedefault = $conf->config('statedefault') + || ($countrydefault eq 'US' ? 'CA' : ''); +$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'); + +$opt{geocode} ||= $cust_main->get('geocode'); + +if ( $conf->exists('cust_main-require_censustract') ) { + $opt{censustract} ||= $cust_main->censustract; +} + +$daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ + ? 'Day' + : FS::Msgcat::_gettext('daytime'); +$night_label = FS::Msgcat::_gettext('night') =~/^(night)?$/ + ? 'Night' + : FS::Msgcat::_gettext('night') || 'Night'; +$mobile_label = FS::Msgcat::_gettext('mobile') =~/^(mobile)?$/ + ? 'Mobile' + : FS::Msgcat::_gettext('mobile') || 'Mobile'; + +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 @invoicing_list = $cust_main->invoicing_list; + +my $agentnum = $cust_main->agentnum if $cust_main->custnum; +