X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fcontacts_new.html;h=0fdcc5371bb7332ac9de32b6fa17121b3133efb7;hb=HEAD;hp=155490fe194a13a9afae5ab9488c70d30de35356;hpb=83f70978574fef3401020cb11cf651d12c139b3b;p=freeside.git diff --git a/httemplate/view/cust_main/contacts_new.html b/httemplate/view/cust_main/contacts_new.html index 155490fe1..0fdcc5371 100644 --- a/httemplate/view/cust_main/contacts_new.html +++ b/httemplate/view/cust_main/contacts_new.html @@ -1,42 +1,86 @@ +% if ( $display and @cust_contacts ) {
Contacts -Edit contacts - -% foreach my $contact ( @contacts ) { -% #XXX maybe this should be a table with alternating colors instead + +<& /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 %> phone +% } + <%$th%>Comment + + + +% my $bgcolor1 = '#ffffff'; +% my $bgcolor2 = '#eeeeee'; +% my $bgcolor = $bgcolor2; +% my $count = 0; +% foreach my $cust_contact ( @cust_contacts ) { +% my $contact = $cust_contact->contact; +% my $td = qq( - - + <%$td%><% $cust_contact->contact_classname |h %> + <%$td%><% $contact->line |h %> % my @contact_email = $contact->contact_email; -% if (@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 + + <& /elements/change_password.html, + 'contact_num' => $cust_contact->contactnum, + 'custnum' => $cust_contact->custnum, + 'no_label_display' => '', + 'label' => 'change password', + 'curr_value' => '', + 'pre_pwd_field_label' => 'contact'.$count.'_', + &> + +% } else { + Disabled +%# enable +% } + % foreach my $phone_type (@phone_type) { % my $contact_phone = % qsearchs('contact_phone', { % 'contactnum' => $contact->contactnum, % 'phonetypenum' => $phone_type->phonetypenum, -% }) -% or next; - - +% }); + <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %> % } -% if ( $contact->comment ) { - - - -% } + <%$td%><% $cust_contact->comment |h %> + +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% $count++; % }
'; +
); +
<% $contact->contact_classname %> Contact<% $contact->line %>   Email<% join(', ', map $_->emailaddress, @contact_email) %>   <% $phone_type->typename %> phone<% $contact_phone->phonenum |h %>   Comment<% $contact->comment |h %>
+%} <%once> -my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'}); +my @phone_type = FS::phone_type->get_phone_types(); <%init> @@ -44,6 +88,10 @@ my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'}); 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) > 0;