Merge pull request #9579 from omarabuhussein/CRM-19801-fix-relationship-saving
[civicrm-core.git] / templates / CRM / Form / basicForm.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
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 {if $htmlField eq 'prior_financial_period'}
46 {include file="CRM/common/jcalendar.tpl" elementName=$htmlField}
47 {else}
48 {$form.$htmlField.html}
49 {/if}
50 {if $desc}
51 <br /><span class="description">{$desc}</span>
52 {/if}
53 </td>
54 {/if}
55 </tr>
56 {/if}
57 {/foreach}
58 {$form.prior_financial_period_M_hidden.html}
59 {$form.prior_financial_period_d_hidden.html}
60 </table>
61 {/if}
62 <table class="form-layout" id="invoicing_blocks">
63 {foreach from=$fields item=field key=fieldName}
64 {assign var=n value=$fieldName}
65 {if $form.$n}
66 <tr class="crm-preferences-form-block-{$fieldName}">
67 {if $field.html_type EQ 'checkbox'|| $field.html_type EQ 'checkboxes'}
68 <td class="label"></td>
69 <td>
70 {$form.$n.html} {$form.$n.label}
71 {if $field.description}
72 <br /><span class="description">{$field.description}</span>
73 {/if}
74 </td>
75 {else}
76 <td class="label">{$form.$n.label}</td>
77 <td>
78 {$form.$n.html}
79 {if $field.description}
80 <br /><span class="description">{$field.description}</span>
81 {/if}
82 </td>
83 {/if}
84 </tr>
85 {/if}
86 {/foreach}
87 </table>
88
89 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
90 </div>
91 {if $formName == "Contribute_Preferences"}
92 {literal}
93 <script type="text/javascript">
94 cj(document).ready(function() {
95 if (document.getElementById("invoicing").checked) {
96 cj("#invoicing_blocks").show();
97 }
98 else {
99 cj("#invoicing_blocks").hide();
100 }
101 });
102 cj(function () {
103 cj("input[type=checkbox]").click(function() {
104 if (cj("#invoicing").is(":checked")) {
105 cj("#invoicing_blocks").show();
106 }
107 else {
108 cj("#invoicing_blocks").hide();
109 }
110 });
111 });
112 </script>
113 {/literal}
114 {/if}