From 9b6494db9ade24ca3e0528c29887d2061442c818 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Thu, 1 Nov 2018 14:59:08 +1300 Subject: [PATCH] Move basicForm.tpl in it's entirity into Contribute.tpl. Contribute.tpl no longer relies on basicForm.tpl so we can clean that up now --- .../CRM/Admin/Form/Preferences/Contribute.tpl | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Admin/Form/Preferences/Contribute.tpl b/templates/CRM/Admin/Form/Preferences/Contribute.tpl index 9baa42d3f2..b93c9bf001 100644 --- a/templates/CRM/Admin/Form/Preferences/Contribute.tpl +++ b/templates/CRM/Admin/Form/Preferences/Contribute.tpl @@ -23,4 +23,61 @@ | 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} {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} -- 2.25.1