Move basicForm.tpl in it's entirity into Contribute.tpl.
authoreileen <emcnaughton@wikimedia.org>
Thu, 1 Nov 2018 01:59:08 +0000 (14:59 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 1 Nov 2018 01:59:08 +0000 (14:59 +1300)
Contribute.tpl no longer relies on basicForm.tpl so we can clean that up now

templates/CRM/Admin/Form/Preferences/Contribute.tpl

index 9baa42d3f2740a939d950514fed9decb26bccf6f..b93c9bf001cd38b15c169f23b897fe0460a47eff 100644 (file)
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
 *}
-{include file="CRM/Form/basicForm.tpl"}
+<div class="crm-block crm-form-block crm-{$formName}-block">
+  <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
+  {if $formName == "Contribute_Preferences"}
+    <table class = "form-layout">
+      {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}
+
+  {include file="CRM/Form/basicFormFields.tpl"}
+  <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
+</div>
+{if $formName == "Contribute_Preferences"}
+{literal}
+  <script type="text/javascript">
+    cj(document).ready(function() {
+      if (document.getElementById("invoicing").checked) {
+        cj("#invoicing_blocks").show();
+      }
+      else {
+        cj("#invoicing_blocks").hide();
+      }
+    });
+    cj(function () {
+      cj("input[type=checkbox]").click(function() {
+        if (cj("#invoicing").is(":checked")) {
+          cj("#invoicing_blocks").show();
+        }
+        else {
+          cj("#invoicing_blocks").hide();
+        }
+      });
+    });
+  </script>
+{/literal}
+{/if}