X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fcontacts.html;h=12b9391a028f1a065df4c9adb10bbbab1ad2e6ed;hb=5214a5560240667a3a914c45df046b420926a5ec;hp=9c2b38f9acb7fb5e60addf0ac56c3d9b69098911;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html index 9c2b38f9a..12b9391a0 100644 --- a/httemplate/view/cust_main/contacts.html +++ b/httemplate/view/cust_main/contacts.html @@ -1,155 +1,156 @@ -% -% my( $cust_main ) = @_; -% my $conf = new FS::Conf; -% +% my %which = ( +% '' => emt('Billing'), +% 'ship_' => emt('Service'), +% ); +% foreach my $which ( '', 'ship_' ) { +% my $pre = $cust_main->get("${which}last") ? $which : ''; - -Billing address -<% ntable("#cccccc") %><% ntable("#cccccc",2) %> +<% $which{$which} %> <% mt('address') |h %> + - - + -% if ( $conf->exists('show_ss') ) { - - - +% if ( $which eq '' && $conf->exists('show_ss') ) { + + % } - - - - - - - - - -% if ( $cust_main->address2 ) { - - - - -% } +% if ( $conf->exists('cust-email-high-visibility') && $which eq '') { + + + + +% } - - - - - - - - - - - - -% -% 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'); -% +% if ( $cust_main->get("${pre}company") ) { + + + + +% } - - + + - - - - - - - - -
Contact name - <% $cust_main->last. ', '. $cust_main->first %> + <% mt('Contact name') |h %> + <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") |h %> SS#<% $cust_main->ss || ' ' %><% mt('SS#') |h %><% $cust_main->masked('ss') || ' ' %>
Company<% $cust_main->company %>
Address<% $cust_main->address1 %>
 <% $cust_main->address2 %>
<% mt('Email address(es)') |h %> + <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %> +
City<% $cust_main->city %>State<% state_label($cust_main->state, $cust_main->country) %>Zip<% $cust_main->zip %>
Country<% code2country($cust_main->country) %>
<% mt('Company') |h %><% $cust_main->get("${pre}company") |h %>
<% $daytime_label %> - <% include('/elements/phonenumber.html', - $cust_main->daytime, - 'callable'=>1 - ) - %> - <% mt('Address') |h %><% $cust_main->get("${pre}address1") |h %>
<% $night_label %> - <% include('/elements/phonenumber.html', - $cust_main->night, - 'callable'=>1 - ) - %> -
Fax - <% $cust_main->fax || ' ' %> -
-% if ( defined $cust_main->dbdef_table->column('ship_last') ) { -% my $pre = $cust_main->ship_last ? 'ship_' : ''; -% - -
-Service address -<% ntable("#cccccc") %><% ntable("#cccccc",2) %> - - Contact name - - <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %> - - - - Company - <% $cust_main->get("${pre}company") %> - - - Address - <% $cust_main->get("${pre}address1") %> - % if ( $cust_main->get("${pre}address2") ) { +% my $address2_label = +% ( $conf->exists('cust_main-require_address2') +% && ! ( $pre xor $cust_main->has_ship_address ) +% ) +% ? emt('Unit #') +% : ' '; + + + <% $address2_label %> + <% $cust_main->get("${pre}address2") |h %> + - -   - <% $cust_main->get("${pre}address2") %> - % } - City - <% $cust_main->get("${pre}city") %> - State - <% $cust_main->get("${pre}state") %> - Zip + <% mt('City') |h %> + <% $cust_main->get("${pre}city") |h %> +% if ( $cust_main->get("${pre}county") ) { + <% mt('County') |h %> + <% $cust_main->get("${pre}county") |h %> +% } + <% mt('State') |h %> + <% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %> + <% mt('Zip') |h %> <% $cust_main->get("${pre}zip") %> - Country + <% mt('Country') |h %> <% code2country( $cust_main->get("${pre}country") ) %> - - <% $daytime_label %> - - <% include('/elements/phonenumber.html', - $cust_main->get("${pre}daytime"), - 'callable'=>1 - ) - %> - - - - <% $night_label %> - - <% include('/elements/phonenumber.html', - $cust_main->get("${pre}night"), - 'callable'=>1 - ) - %> - - - - Fax - - <% $cust_main->get("${pre}fax") || ' ' %> - - - + +% if ( $cust_main->get($pre.'latitude') && $cust_main->get($pre.'longitude') ) { + <& /elements/tr-coords.html, $cust_main->get($pre.'latitude'), + $cust_main->get($pre.'longitude'), + $cust_main->name_short, + $cust_main->agentnum, + &> +% } + +% foreach my $phone (grep $cust_main->get($pre.$_), qw( daytime night mobile )){ + + + <% $phone_label{$phone} %> + + <& /elements/phonenumber.html, + $cust_main->get($pre.$phone), + 'callable'=>1, + 'calling_list_exempt'=>$cust_main->calling_list_exempt, + &> + + + +% } + +% if ( $cust_main->get("${pre}fax") ) { + + <% mt('Fax') |h %> + + <% $cust_main->get("${pre}fax") || ' ' %> + + +% } + +% if ( $which eq '' && $conf->exists('show_stateid') ) { + + <% $stateid_label %> + <% $cust_main->masked('stateid') || ' ' %> + <% $stateid_state_label %> + <% $cust_main->stateid_state || ' ' %> + +% } + + +% if ( $which ne 'ship_' ) { +
+% } % } +<%once> + +my %phone_label = ( + + 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ + ? 'Day Phone' + : FS::Msgcat::_gettext('daytime') + ), + + 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/ + ? 'Night Phone' + : FS::Msgcat::_gettext('night') + ), + + 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/ + ? 'Mobile Phone' + : FS::Msgcat::_gettext('Mobile') + ), +); + +my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/ + ? 'Driver’s License' + : FS::Msgcat::_gettext('stateid'); +my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/ + ? 'Driver’s License State' + : FS::Msgcat::_gettext('stateid_state'); + + +<%init> + +my( $cust_main ) = @_; +my $conf = new FS::Conf; +my @invoicing_list = $cust_main->invoicing_list; +my $no = emt('no'); + +