normalize contact phone formatting
[freeside.git] / httemplate / elements / contact.html
index 490ba23..8abce05 100644 (file)
@@ -2,9 +2,9 @@
 
   <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
 
-  <TABLE>
+  <TABLE STYLE="display:inline">
     <TR>
-%     if ( @contact_class ) {
+%     if ( @contact_class && ! $opt{name_only} ) {
         <TD>
           <SELECT NAME="<%$name%>_classnum" <% $onchange %>>
             <OPTION VALUE="">
@@ -31,7 +31,7 @@
 %           'phonetypenum' => $1,
 %         });
 %         if ( $contact_phone ) {
-%           $value = $contact_phone->phonenum;
+%           $value = $contact_phone->phonenum_pretty;
 %           $value .= 'x'.$contact_phone->extension
 %             if $contact_phone->extension;
 %           $value = '+'. $contact_phone->countrycode. " $value"
@@ -106,6 +106,6 @@ foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) {
 
 $label{'comment'} = 'Comment';
 
-my @fields = keys %label;
+my @fields = $opt{'name_only'} ? qw( first last ) : keys %label;
 
 </%init>