RT# 77532 - fixed error where cust main fax not showing, and fixed checking of phonet...
[freeside.git] / httemplate / view / cust_main / contacts_new.html
index 9448867..0fdcc53 100644 (file)
   <%$th%>Contact</TH>
   <%$th%>Email</TH>
   <%$th%>Send invoices</TH>
+  <%$th%>Send messages</TH>
   <%$th%>Self-service</TH>
 % foreach my $phone_type (@phone_type) {
-    <%$th%><% $phone_type->typename |h %></TH>
+    <%$th%><% $phone_type->typename |h %> phone</TH>
 % }
   <%$th%>Comment</TH>
 </TR>
@@ -21,6 +22,7 @@
 %   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 CLASS="grid" BGCOLOR="$bgcolor">);
 %       my @contact_email = $contact->contact_email;
         <%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
         <%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %></TD>
+        <%$td%><% $cust_contact->message_dest eq 'Y' ? 'Yes' : 'No' %></TD>
         <%$td%>
 %         if ( $cust_contact->selfservice_access ) {
             Enabled
 %#            <FONT SIZE="-1"><A HREF="XXX">disable</A>
 %#                            <A HREF="XXX">re-email</A></FONT>
+            <FONT SIZE="-1">
+              <& /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.'_',
+              &>
+            </FONT>
 %         } else {
             Disabled
 %#            <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
 %      } else {
 %        $bgcolor = $bgcolor1;
 %      }
+%     $count++;
 %   }
 </TABLE>
 %}
 <%once>
 
-my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
+my @phone_type = FS::phone_type->get_phone_types();
 
 </%once>
 <%init>
@@ -78,6 +92,6 @@ 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;
+my $display = scalar(@cust_contacts) > 0;
 
 </%init>