Merge pull request #9886 from JMAConsulting/CRM-20169
[civicrm-core.git] / templates / CRM / Form / basicForm.tpl
index 694385a8d37124601f17fe043e86a75ae8a651dc..2b15663b414b75246e6277dbe4d082a4fd4d41c0 100644 (file)
@@ -2,7 +2,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
     <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
     {if $formName == "Contribute_Preferences"}
       <table class = "form-layout">
-        <tr class="crm-miscellaneous-form-block-cvv-backoffice-required">
-          <td class="label">{$form.cvv_backoffice_required.label}</td>
-          <td>
-            {$form.cvv_backoffice_required.html}<br />
-            <p class="description">{ts}{$cvv_backoffice_required_description}{/ts}</p>
-          </td>
-        </tr>
-        <tr class="crm-preferences-form-block-acl_financial_type">
-          <td class="label">{$form.acl_financial_type.label}&nbsp;{help id="acl_financial_type"}</td>
-          <td>
-            {$form.acl_financial_type.html}
-          </td>
-        </tr>
-        {if $formName == "Contribute_Preferences" }
-          <tr class="crm-preferences-form-block-invoicing">
-            <td class="label">{$form.invoicing.label}</td>
-            <td>
-              {$form.invoicing.html}
-            </td>
-          </tr>
-        {/if}
+        {foreach from=$htmlFields item=desc key=htmlField}
+          {if $form.$htmlField}
+           {assign var=n value=$htmlField|cat:'_description'}
+            <tr class="crm-preferences-form-block-{$htmlField}">
+              {if $form.$htmlField.html_type EQ 'checkbox'|| $form.$htmlField.html_type EQ 'checkboxes'}
+                <td class="label"></td>
+                <td>
+                  {$form.$htmlField.html} {$form.$htmlField.label}
+                  {if $desc}
+                    <br /><span class="description">{$desc}</span>
+                  {/if}
+                </td>
+              {else}
+                <td class="label">{$form.$htmlField.label}&nbsp;{if $htmlField eq 'acl_financial_type'}{help id="$htmlField"}{/if}</td>
+                <td>
+                  {$form.$htmlField.html}
+                  {if $desc}
+                    <br /><span class="description">{$desc}</span>
+                  {/if}
+                </td>
+              {/if}
+            </tr>
+          {/if}
+        {/foreach}
       </table>
     {/if}
     <table class="form-layout" id="invoicing_blocks">