Make it possible to hide the pref mail format in a buildForm hook (in the 'Page'...
authorMathieu Lutfy <mathieu@bidon.ca>
Thu, 11 Apr 2013 14:40:10 +0000 (10:40 -0400)
committerMathieu Lutfy <mathieu@bidon.ca>
Thu, 11 Apr 2013 14:40:10 +0000 (10:40 -0400)
templates/CRM/Contact/Form/Edit/CommunicationPreferences.tpl
templates/CRM/Contact/Form/Inline/CommunicationPreferences.tpl

index ef2cc45bf0cd7770511d39038944c267f12e081a..ecf0c3febfda072c862704aa0e2ed4e94ef5d5be 100644 (file)
         </tr>
         <tr>
             <td>{$form.is_opt_out.html} {$form.is_opt_out.label} {help id="id-optOut" file="CRM/Contact/Form/Contact.hlp"}</td>
-            <td>{$form.preferred_mail_format.label} &nbsp;
-                {$form.preferred_mail_format.html} {help id="id-emailFormat" file="CRM/Contact/Form/Contact.hlp"}
-            </td>
-
+            {if !empty($form.preferred_mail_format)}
+                <td>{$form.preferred_mail_format.label} &nbsp;
+                    {$form.preferred_mail_format.html} {help id="id-emailFormat" file="CRM/Contact/Form/Contact.hlp"}
+                </td>
+            {/if}
         </tr>
     </table>
  </div><!-- /.crm-accordion-body -->
index 4c31c6756ff7ab8da606fd20cef00f31090d71e5..a1efb9cb67be64baabf5f71d0e065602b93b3a30 100644 (file)
@@ -60,6 +60,8 @@
           {$form.preferred_language.html}
         </div>
       </div>
+
+      {if !empty($form.preferred_mail_format)}
       <div class="crm-summary-row">
         <div class="crm-label">
           {$form.preferred_mail_format.label}
@@ -68,6 +70,7 @@
           {$form.preferred_mail_format.html} {help id="id-emailFormat" file="CRM/Contact/Form/Contact.hlp"}
         </div>
       </div>
+      {/if}
 
       {if !empty($form.email_greeting_id)}
       <div class="crm-summary-row">