X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fcontacts_new.html;h=fe412cc00365db0043320f4413ab59ef33ee5209;hp=bd812c7e7f14e4f3bab08612b21c9833dfd371f0;hb=4747bfbea3f4abb66d05a2bd1abed69e28a4aa3d;hpb=8e5fab2148c7dc492b9fffe271c3dcf8df55b01f diff --git a/httemplate/view/cust_main/contacts_new.html b/httemplate/view/cust_main/contacts_new.html index bd812c7e7..fe412cc00 100644 --- a/httemplate/view/cust_main/contacts_new.html +++ b/httemplate/view/cust_main/contacts_new.html @@ -1,22 +1,85 @@ -% if ( @contacts ) { +% if ( $display and @cust_contacts ) {
-Contacts -<% ntable("#cccccc",2) %> -% foreach my $contact ( @contacts ) { +Contacts + +<& /elements/table-grid.html &> + +% my $th = ''; + + <%$th%>Type + <%$th%>Contact + <%$th%>Email + <%$th%>Send invoices + <%$th%>Send messages + <%$th%>Self-service +% foreach my $phone_type (@phone_type) { + <%$th%><% $phone_type->typename |h %> +% } + <%$th%>Comment + + + +% my $bgcolor1 = '#ffffff'; +% my $bgcolor2 = '#eeeeee'; +% my $bgcolor = $bgcolor2; +% foreach my $cust_contact ( @cust_contacts ) { +% my $contact = $cust_contact->contact; +% my $td = qq(); + - Contact - <% $contact->line %> + <%$td%><% $cust_contact->contact_classname |h %> + <%$td%><% $contact->line |h %> + +% my @contact_email = $contact->contact_email; + <%$td%><% join(', ', map $_->emailaddress, @contact_email) %> + <%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %> + <%$td%><% $cust_contact->message_dest eq 'Y' ? 'Yes' : 'No' %> + <%$td%> +% if ( $cust_contact->selfservice_access ) { + Enabled +%# disable +%# re-email +% } else { + Disabled +%# enable +% } + + +% foreach my $phone_type (@phone_type) { +% my $contact_phone = +% qsearchs('contact_phone', { +% 'contactnum' => $contact->contactnum, +% 'phonetypenum' => $phone_type->phonetypenum, +% }); + <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %> +% } + + <%$td%><% $cust_contact->comment |h %> + + +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } % } +%} +<%once> -% } +my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'}); + <%init> my( $cust_main ) = @_; #my $conf = new FS::Conf; -my @contacts = $cust_main->cust_contact; +my @cust_contacts = $cust_main->cust_contact; + +# residential customers have a default "invisible" contact, but if they +# somehow get more than one contact, show them +my $display = scalar(@cust_contacts) > 1;