Merge pull request #12475 from mattwire/CRM-21574_disable_contact_email_tellafriend
[civicrm-core.git] / templates / CRM / Form / basicForm.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 *}
26 <div class="crm-block crm-form-block crm-{$formName}-block">
27 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
28 {if $formName == "Contribute_Preferences"}
29 <table class = "form-layout">
30 {foreach from=$htmlFields item=desc key=htmlField}
31 {if $form.$htmlField}
32 {assign var=n value=$htmlField|cat:'_description'}
33 <tr class="crm-preferences-form-block-{$htmlField}">
34 {if $form.$htmlField.html_type EQ 'checkbox'|| $form.$htmlField.html_type EQ 'checkboxes'}
35 <td class="label"></td>
36 <td>
37 {$form.$htmlField.html} {$form.$htmlField.label}
38 {if $desc}
39 <br /><span class="description">{$desc}</span>
40 {/if}
41 </td>
42 {else}
43 <td class="label">{$form.$htmlField.label}&nbsp;{if $htmlField eq 'acl_financial_type'}{help id="$htmlField"}{/if}</td>
44 <td>
45 {$form.$htmlField.html}
46 {if $desc}
47 <br /><span class="description">{$desc}</span>
48 {/if}
49 </td>
50 {/if}
51 </tr>
52 {/if}
53 {/foreach}
54 </table>
55 {/if}
56 <table class="form-layout" id="invoicing_blocks">
57 {foreach from=$fields item=field key=fieldName}
58 {assign var=n value=$fieldName}
59 {if $form.$n}
60 <tr class="crm-preferences-form-block-{$fieldName}">
61 {if $field.html_type EQ 'checkbox'|| $field.html_type EQ 'checkboxes'}
62 <td class="label"></td>
63 <td>
64 {$form.$n.html} {$form.$n.label}
65 {if $field.description}
66 <br /><span class="description">{$field.description}</span>
67 {/if}
68 </td>
69 {else}
70 <td class="label">{$form.$n.label}</td>
71 <td>
72 {$form.$n.html}
73 {if $field.description}
74 <br /><span class="description">{$field.description}</span>
75 {/if}
76 </td>
77 {/if}
78 </tr>
79 {/if}
80 {/foreach}
81 </table>
82
83 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
84 </div>
85 {if $formName == "Contribute_Preferences"}
86 {literal}
87 <script type="text/javascript">
88 cj(document).ready(function() {
89 if (document.getElementById("invoicing").checked) {
90 cj("#invoicing_blocks").show();
91 }
92 else {
93 cj("#invoicing_blocks").hide();
94 }
95 });
96 cj(function () {
97 cj("input[type=checkbox]").click(function() {
98 if (cj("#invoicing").is(":checked")) {
99 cj("#invoicing_blocks").show();
100 }
101 else {
102 cj("#invoicing_blocks").hide();
103 }
104 });
105 });
106 </script>
107 {/literal}
108 {/if}