X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fcontacts.html;h=d5788c9a491c67602c3cf63c2b1277f678940bd5;hb=17856ff5c299e4db21da28116f2666655c03f2c7;hp=456d117a64289b0ee8063f74c7426b2c2e0145f0;hpb=8d4abaa99403699aa5b5f02e899d2ea33980f913;p=freeside.git diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html index 456d117a6..d5788c9a4 100644 --- a/httemplate/view/cust_main/contacts.html +++ b/httemplate/view/cust_main/contacts.html @@ -1,131 +1,100 @@ -<% - my( $cust_main ) = @_; - my $conf = new FS::Conf; -%> +% my %which = ( +% '' => 'Billing', +% 'ship_' => 'Service', +% ); +% foreach my $which ( '', 'ship_' ) { +% my $pre = $cust_main->get("${which}last") ? $which : ''; -Billing address -<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %> - - Contact name - - <%= $cust_main->last. ', '. $cust_main->first %> - -<% if ( $conf->exists('show_ss') ) { %> - SS# - <%= $cust_main->ss || ' ' %> -<% } %> - - - Company - <%= $cust_main->company %> - - - Address - <%= $cust_main->address1 %> - -<% if ( $cust_main->address2 ) { %> - -   - <%= $cust_main->address2 %> - -<% } %> - - City - <%= $cust_main->city %> - State - <%= $cust_main->state %> - Zip - <%= $cust_main->zip %> - - - Country - <%= $cust_main->country %> - -<% - 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'); -%> - - <%= $daytime_label %> - - <%= $cust_main->daytime || ' ' %> - - - - <%= $night_label %> - - <%= $cust_main->night || ' ' %> - - - - 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) %> +<% $which{$which} %> address +<% ntable("#cccccc") %><% ntable("#cccccc",2) %> Contact name - <%= $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %> + <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %> +% if ( $which eq '' && $conf->exists('show_ss') ) { + SS# + <% $cust_main->ss || ' ' %> +% } Company - <%= $cust_main->get("${pre}company") %> + <% $cust_main->get("${pre}company") %> Address - <%= $cust_main->get("${pre}address1") %> + <% $cust_main->get("${pre}address1") %> -<% if ( $cust_main->get("${pre}address2") ) { %> +% if ( $cust_main->get("${pre}address2") ) { +   - <%= $cust_main->get("${pre}address2") %> + <% $cust_main->get("${pre}address2") %> -<% } %> +% } + City - <%= $cust_main->get("${pre}city") %> + <% $cust_main->get("${pre}city") %> +% if ( $cust_main->get("${pre}county") ) { + County + <% $cust_main->get("${pre}county") %> +% } State - <%= $cust_main->get("${pre}state") %> + <% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) %> Zip - <%= $cust_main->get("${pre}zip") %> + <% $cust_main->get("${pre}zip") %> Country - <%= $cust_main->get("${pre}country") %> + <% code2country( $cust_main->get("${pre}country") ) %> - <%= $daytime_label %> - - <%= $cust_main->get("${pre}daytime") || ' ' %> + <% $daytime_label %> + + <% include('/elements/phonenumber.html', + $cust_main->get("${pre}daytime"), + 'callable'=>1 + ) + %> - <%= $night_label %> - - <%= $cust_main->get("${pre}night") || ' ' %> + <% $night_label %> + + <% include('/elements/phonenumber.html', + $cust_main->get("${pre}night"), + 'callable'=>1 + ) + %> Fax - - <%= $cust_main->get("${pre}fax") || ' ' %> + + <% $cust_main->get("${pre}fax") || ' ' %> +% if ( $which ne 'ship_' ) { +
+% } +% } + +<%once> + +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'); + + +<%init> + +my( $cust_main ) = @_; +my $conf = new FS::Conf; + + -<% } %>