2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
26 {* Callback snippet: On-behalf profile *}
27 {if $snippet and !empty($isOnBehalfCallback) and !$ccid}
28 <div class="crm-public-form-item crm-section">
29 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl" context="front-end"}
33 <script type="text/javascript">
35 // Putting these functions directly in template so they are available for standalone forms
36 function useAmountOther() {
37 var priceset = {/literal}{if $contriPriceset}'{$contriPriceset}'{else}0{/if}{literal};
39 for( i=0; i < document.Main.elements.length; i++ ) {
40 element = document.Main.elements[i];
41 if ( element.type == 'radio' && element.name == priceset ) {
42 if (element.value == '0' ) {
46 element.checked = false;
52 function clearAmountOther() {
53 var priceset = {/literal}{if $priceset}'#{$priceset}'{else}0{/if}{literal}
58 if (document.Main.amount_other == null) return; // other_amt field not present; do nothing
59 document.Main.amount_other.value = "";
66 {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
69 {include file="CRM/common/TrackingFields.tpl"}
71 <div class="crm-contribution-page-id-{$contributionPageID} crm-block crm-form-block crm-contribution-main-form-block">
73 {if $contact_id && !$ccid}
74 <div class="messages status no-popup crm-not-you-message">
75 {ts 1=$display_name}Welcome %1{/ts}. (<a href="{crmURL p='civicrm/contribute/transact' q="cid=0&reset=1&id=`$contributionPageID`"}" title="{ts}Click here to do this for a different person.{/ts}">{ts 1=$display_name}Not %1, or want to do this for a different person{/ts}</a>?)
79 <div id="intro_text" class="crm-public-form-item crm-section intro_text-section">
82 {include file="CRM/common/cidzero.tpl"}
83 {if $islifetime or $ispricelifetime }
84 <div class="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
87 {if !empty($useForMember) && !$ccid}
88 <div class="crm-public-form-item crm-section">
89 {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
91 {elseif !empty($ccid)}
92 {if $lineItem && $priceSetID && !$is_quick_config}
93 <div class="header-dark">
94 {ts}Contribution Information{/ts}{if $display_name} – {$display_name}{/if}
96 {assign var="totalAmount" value=$pendingAmount}
97 {include file="CRM/Price/Page/LineItem.tpl" context="Contribution"}
99 <div class="display-block">
100 <td class="label">{$form.total_amount.label}</td>
101 <td><span>{$form.total_amount.html|crmMoney} {if $taxAmount}(includes {$taxTerm} of {$taxAmount|crmMoney}){/if}</span></td>
105 <div id="priceset-div">
106 {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
111 {crmRegion name='contribution-main-pledge-block'}
113 {if $is_pledge_payment}
114 <div class="crm-public-form-item crm-section {$form.pledge_amount.name}-section">
115 <div class="label">{$form.pledge_amount.label} <span class="crm-marker">*</span></div>
116 <div class="content">{$form.pledge_amount.html}</div>
117 <div class="clear"></div>
120 <div class="crm-public-form-item crm-section {$form.is_pledge.name}-section">
121 <div class="label"> </div>
122 <div class="content">
123 {$form.is_pledge.html}
124 {if $is_pledge_interval}
125 {$form.pledge_frequency_interval.html}
127 {$form.pledge_frequency_unit.html}<span id="pledge_installments_num"> {ts}for{/ts} {$form.pledge_installments.html} {ts}installments.{/ts}</span>
129 <div class="clear"></div>
130 {if $start_date_editable}
132 <div class="label">{$form.start_date.label}</div><div class="content">{include file="CRM/common/jcalendar.tpl" elementName=start_date}</div>
134 <div class="label">{$form.start_date.label}</div><div class="content">{$form.start_date.html}</div>
137 <div class="label">{$form.start_date.label}</div>
138 <div class="content">{$start_date_display|date_format}</div>
140 <div class="clear"></div>
147 <div class="crm-public-form-item crm-section {$form.is_recur.name}-section">
148 <div class="label"> </div>
149 <div class="content">
150 {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
151 {if $is_recur_interval}
152 {$form.frequency_interval.html}
154 {if $one_frequency_unit}
157 {$form.frequency_unit.html}
159 {if $is_recur_installments}
160 <span id="recur_installments_num">
161 {ts}for{/ts} {$form.installments.html} {$form.installments.label}
164 <div id="recurHelp" class="description">
168 <div class="clear"></div>
171 {if $pcpSupporterText}
172 <div class="crm-public-form-item crm-section pcpSupporterText-section">
173 <div class="label"> </div>
174 <div class="content">{$pcpSupporterText}</div>
175 <div class="clear"></div>
179 {assign var=n value=email-$bltID}
180 <div class="crm-public-form-item crm-section {$form.$n.name}-section">
181 <div class="label">{$form.$n.label}</div>
182 <div class="content">
185 <div class="clear"></div>
189 <div id='onBehalfOfOrg' class="crm-public-form-item crm-section">
190 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl"}
193 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
194 <div class="crm-public-form-item crm-section cms_user-section">
195 {include file="CRM/common/CMSUser.tpl"}
197 <div class="crm-public-form-item crm-section premium_block-section">
198 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
201 {if $honoreeProfileFields|@count}
202 <fieldset class="crm-public-form-item crm-group honor_block-group">
203 {crmRegion name="contribution-soft-credit-block"}
204 <legend>{$honor_block_title}</legend>
205 <div class="crm-public-form-item crm-section honor_block_text-section">
208 {if $form.soft_credit_type_id.html}
209 <div class="crm-public-form-item crm-section {$form.soft_credit_type_id.name}-section">
210 <div class="content" >
211 {$form.soft_credit_type_id.html}
212 <div class="description">{ts}Select an option to reveal honoree information fields.{/ts}</div>
217 <div id="honorType" class="honoree-name-email-section">
218 {include file="CRM/UF/Form/Block.tpl" fields=$honoreeProfileFields mode=8 prefix='honor'}
223 <div class="crm-public-form-item crm-group custom_pre_profile-group">
224 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
228 <fieldset class="crm-public-form-item crm-group pcp-group">
229 <div class="crm-public-form-item crm-section pcp-section">
230 <div class="crm-public-form-item crm-section display_in_roll-section">
231 <div class="content">
232 {$form.pcp_display_in_roll.html}
233 {$form.pcp_display_in_roll.label}
235 <div class="clear"></div>
237 <div id="nameID" class="crm-public-form-item crm-section is_anonymous-section">
238 <div class="content">
239 {$form.pcp_is_anonymous.html}
241 <div class="clear"></div>
243 <div id="nickID" class="crm-public-form-item crm-section pcp_roll_nickname-section">
244 <div class="label">{$form.pcp_roll_nickname.label}</div>
245 <div class="content">{$form.pcp_roll_nickname.html}
246 <div class="description">{ts}Enter the name you want listed with this contribution. You can use a nick name like 'The Jones Family' or 'Sarah and Sam'.{/ts}</div>
248 <div class="clear"></div>
250 <div id="personalNoteID" class="crm-public-form-item crm-section pcp_personal_note-section">
251 <div class="label">{$form.pcp_personal_note.label}</div>
252 <div class="content">
253 {$form.pcp_personal_note.html}
254 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
256 <div class="clear"></div>
262 {* end of ccid loop *}
265 {if $form.payment_processor_id.label}
266 {* PP selection only works with JS enabled, so we hide it initially *}
267 <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;">
268 <legend>{ts}Payment Options{/ts}</legend>
269 <div class="crm-public-form-item crm-section payment_processor-section">
270 <div class="label">{$form.payment_processor_id.label}</div>
271 <div class="content">{$form.payment_processor_id.html}</div>
272 <div class="clear"></div>
278 <fieldset class="crm-public-form-item crm-group pay_later-group">
279 <legend>{ts}Payment Options{/ts}</legend>
280 <div class="crm-public-form-item crm-section pay_later_receipt-section">
281 <div class="label"> </div>
282 <div class="content">
283 [x] {$pay_later_text}
285 <div class="clear"></div>
290 <div id="billing-payment-block">
291 {include file="CRM/Financial/Form/Payment.tpl" snippet=4}
293 {include file="CRM/common/paymentBlock.tpl"}
295 <div class="crm-public-form-item crm-group custom_post_profile-group">
296 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
299 {if $is_monetary and $form.bank_account_number}
300 <div id="payment_notice">
301 <fieldset class="crm-public-form-item crm-group payment_notice-group">
302 <legend>{ts}Agreement{/ts}</legend>
303 {ts}Your account data will be used to charge your bank account via direct debit. While submitting this form you agree to the charging of your bank account via direct debit.{/ts}
309 {include file='CRM/common/ReCAPTCHA.tpl'}
311 <div id="crm-submit-buttons" class="crm-submit-buttons">
312 {include file="CRM/common/formButtons.tpl" location="bottom"}
315 <div id="footer_text" class="crm-public-form-item crm-section contribution_footer_text-section">
316 <p>{$footer_text}</p>
320 <script type="text/javascript">
327 cj('input[name="soft_credit_type_id"]').on('change', function() {
331 function enableHonorType( ) {
332 var selectedValue = cj('input[name="soft_credit_type_id"]:checked');
333 if ( selectedValue.val() > 0) {
334 cj('#honorType').show();
337 cj('#honorType').hide();
341 cj('input[id="is_recur"]').on('change', function() {
345 function toggleRecur( ) {
346 var isRecur = cj('input[id="is_recur"]:checked');
347 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
348 var quickConfig = {/literal}{$quickConfig}{literal};
349 if ( allowAutoRenew && cj("#auto_renew") && quickConfig) {
350 showHideAutoRenew( null );
352 if (isRecur.val() > 0) {
353 cj('#recurHelp').show();
354 cj('#amount_sum_label').text('{/literal}{ts escape='js'}Regular amount{/ts}{literal}');
357 cj('#recurHelp').hide();
358 cj('#amount_sum_label').text('{/literal}{ts escape='js'}Total Amount{/ts}{literal}');
362 function pcpAnonymous( ) {
363 // clear nickname field if anonymous is true
364 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
365 document.getElementById('pcp_roll_nickname').value = '';
367 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
368 cj('#nickID').hide();
369 cj('#nameID').hide();
370 cj('#personalNoteID').hide();
373 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
374 cj('#nameID').show();
375 cj('#nickID').show();
376 cj('#personalNoteID').show();
379 cj('#nameID').show();
380 cj('#nickID').hide();
381 cj('#personalNoteID').hide();
393 // highlight price sets
394 function updatePriceSetHighlight() {
395 $('#priceset .price-set-row span').removeClass('highlight');
396 $('#priceset .price-set-row input:checked').parent().addClass('highlight');
398 $('#priceset input[type="radio"]').change(updatePriceSetHighlight);
399 updatePriceSetHighlight();
401 // Update pledge contribution amount when pledge checkboxes change
402 $("input[name^='pledge_amount']").on('change', function() {
404 $("input[name^='pledge_amount']:checked").each(function() {
405 total += Number($(this).attr('amount'));
407 $("input[name^='price_']").val(total.toFixed(2));
414 {* jQuery validate *}
415 {* disabled because more work needs to be done to conditionally require credit card fields *}
416 {*include file="CRM/Form/validate.tpl"*}