Merge pull request #15784 from civicrm/5.20
[civicrm-core.git] / templates / CRM / Form / basicFormFields.tpl
index d5d292b8d9fb65d18381f851d242034291e7a73a..c769e2cd610e6663316ed1e0e3a256f28b84d2ea 100644 (file)
@@ -2,7 +2,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
 *}
-{* @todo the invoicing_blocks id is used by contribution preferences - get that out of the shared code & back to where it belongs *}
 {* @todo with a small amount of tinkering most of this can be replaced by re-using the foreach loop in CRM_Core_EntityForm.tpl *}
-<table class="form-layout" id="invoicing_blocks">
-  {foreach from=$fields item=field key=fieldName}
-    {assign var=n value=$fieldName}
-    {if $form.$n}
-      <tr class="crm-preferences-form-block-{$fieldName}">
-        {if $field.html_type EQ 'checkbox'|| $field.html_type EQ 'checkboxes'}
-          <td class="label"></td>
-          <td>
-            {$form.$n.html}
-            {if $field.description}
-              <br /><span class="description">{$field.description}</span>
-            {/if}
-          </td>
-        {else}
-          <td class="label">{$form.$n.label}</td>
-          <td>
-            {$form.$n.html}
-            {if $field.description}
-              <br /><span class="description">{$field.description}</span>
-            {/if}
-          </td>
-        {/if}
-      </tr>
-    {/if}
+<table class="form-layout">
+
+  {foreach from=$fields item=fieldSpec}
+    {assign var=fieldName value=$fieldSpec.name}
+    <tr class="crm-{$entityInClassFormat}-form-block-{$fieldName}">
+      {include file="CRM/Core/Form/Field.tpl"}
+    </tr>
   {/foreach}
 </table>