2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
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 {if $displayCaptchaWarning}
70 <div class="messages status no-popup">
71 {ts}To display reCAPTCHA on form you must get an API key from<br /> <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>{/ts}
75 {include file="CRM/common/TrackingFields.tpl"}
77 <div class="crm-contribution-page-id-{$contributionPageID} crm-block crm-contribution-main-form-block">
79 {if $contact_id && !$ccid}
80 <div class="messages status no-popup crm-not-you-message">
81 {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>?)
85 <div id="intro_text" class="crm-public-form-item crm-section intro_text-section">
88 {include file="CRM/common/cidzero.tpl"}
89 {if $islifetime or $ispricelifetime }
90 <div class="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
93 {if !empty($useForMember) && !$ccid}
94 <div class="crm-public-form-item crm-section">
95 {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
97 {elseif !empty($ccid)}
98 {if $lineItem && $priceSetID && !$is_quick_config}
99 <div class="header-dark">
100 {ts}Contribution Information{/ts}{if $display_name} – {$display_name}{/if}
102 {assign var="totalAmount" value=$pendingAmount}
103 {include file="CRM/Price/Page/LineItem.tpl" context="Contribution"}
105 <div class="display-block">
106 <td class="label">{$form.total_amount.label}</td>
107 <td><span>{$form.total_amount.html|crmMoney} {if $taxAmount}{ts 1=$taxTerm 2=$taxAmount|crmMoney}(includes %1 of %2){/ts}{/if}</span></td>
111 <div id="priceset-div">
112 {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
117 {crmRegion name='contribution-main-pledge-block'}
119 {if $is_pledge_payment}
120 <div class="crm-public-form-item crm-section {$form.pledge_amount.name}-section">
121 <div class="label">{$form.pledge_amount.label} <span class="crm-marker">*</span></div>
122 <div class="content">{$form.pledge_amount.html}</div>
123 <div class="clear"></div>
126 <div class="crm-public-form-item crm-section {$form.is_pledge.name}-section">
127 <div class="label"> </div>
128 <div class="content">
129 {$form.is_pledge.html}
130 {if $is_pledge_interval}
131 {$form.pledge_frequency_interval.html}
133 {$form.pledge_frequency_unit.html}<span id="pledge_installments_num"> {ts}for{/ts} {$form.pledge_installments.html} {ts}installments.{/ts}</span>
135 <div class="clear"></div>
136 {if $start_date_editable}
138 <div class="label">{$form.start_date.label}</div><div class="content">{include file="CRM/common/jcalendar.tpl" elementName=start_date}</div>
140 <div class="label">{$form.start_date.label}</div><div class="content">{$form.start_date.html}</div>
143 <div class="label">{$form.start_date.label}</div>
144 <div class="content">{$start_date_display|date_format}</div>
146 <div class="clear"></div>
153 <div class="crm-public-form-item crm-section {$form.is_recur.name}-section">
154 <div class="label"> </div>
155 <div class="content">
156 {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
157 {if $is_recur_interval}
158 {$form.frequency_interval.html}
160 {if $one_frequency_unit}
163 {$form.frequency_unit.html}
165 {if $is_recur_installments}
166 <span id="recur_installments_num">
167 {ts}for{/ts} {$form.installments.html} {$form.installments.label}
170 <div id="recurHelp" class="description">
174 <div class="clear"></div>
177 {if $pcpSupporterText}
178 <div class="crm-public-form-item crm-section pcpSupporterText-section">
179 <div class="label"> </div>
180 <div class="content">{$pcpSupporterText}</div>
181 <div class="clear"></div>
185 {assign var=n value=email-$bltID}
186 <div class="crm-public-form-item crm-section {$form.$n.name}-section">
187 <div class="label">{$form.$n.label}</div>
188 <div class="content">
191 <div class="clear"></div>
195 <div id='onBehalfOfOrg' class="crm-public-form-item crm-section">
196 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl"}
199 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
200 <div class="crm-public-form-item crm-section cms_user-section">
201 {include file="CRM/common/CMSUser.tpl"}
203 <div class="crm-public-form-item crm-section premium_block-section">
204 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
207 {if $honoreeProfileFields && $honoreeProfileFields|@count}
208 <fieldset class="crm-public-form-item crm-group honor_block-group">
209 {crmRegion name="contribution-soft-credit-block"}
210 <legend>{$honor_block_title}</legend>
211 <div class="crm-public-form-item crm-section honor_block_text-section">
214 {if $form.soft_credit_type_id.html}
215 <div class="crm-public-form-item crm-section {$form.soft_credit_type_id.name}-section">
216 <div class="content" >
217 {$form.soft_credit_type_id.html}
218 <div class="description">{ts}Select an option to reveal honoree information fields.{/ts}</div>
223 <div id="honorType" class="honoree-name-email-section">
224 {include file="CRM/UF/Form/Block.tpl" fields=$honoreeProfileFields mode=8 prefix='honor'}
229 <div class="crm-public-form-item crm-group custom_pre_profile-group">
230 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
234 <fieldset class="crm-public-form-item crm-group pcp-group">
235 <div class="crm-public-form-item crm-section pcp-section">
236 <div class="crm-public-form-item crm-section display_in_roll-section">
237 <div class="content">
238 {$form.pcp_display_in_roll.html}
239 {$form.pcp_display_in_roll.label}
241 <div class="clear"></div>
243 <div id="nameID" class="crm-public-form-item crm-section is_anonymous-section">
244 <div class="content">
245 {$form.pcp_is_anonymous.html}
247 <div class="clear"></div>
249 <div id="nickID" class="crm-public-form-item crm-section pcp_roll_nickname-section">
250 <div class="label">{$form.pcp_roll_nickname.label}</div>
251 <div class="content">{$form.pcp_roll_nickname.html}
252 <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>
254 <div class="clear"></div>
256 <div id="personalNoteID" class="crm-public-form-item crm-section pcp_personal_note-section">
257 <div class="label">{$form.pcp_personal_note.label}</div>
258 <div class="content">
259 {$form.pcp_personal_note.html}
260 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
262 <div class="clear"></div>
268 {* end of ccid loop *}
271 {if $form.payment_processor_id.label}
272 {* PP selection only works with JS enabled, so we hide it initially *}
273 <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;">
274 <legend>{ts}Payment Options{/ts}</legend>
275 <div class="crm-public-form-item crm-section payment_processor-section">
276 <div class="label">{$form.payment_processor_id.label}</div>
277 <div class="content">{$form.payment_processor_id.html}</div>
278 <div class="clear"></div>
284 <fieldset class="crm-public-form-item crm-group pay_later-group">
285 <legend>{ts}Payment Options{/ts}</legend>
286 <div class="crm-public-form-item crm-section pay_later_receipt-section">
287 <div class="label"> </div>
288 <div class="content">
289 [x] {$pay_later_text}
291 <div class="clear"></div>
296 {include file="CRM/Core/BillingBlockWrapper.tpl"}
298 <div class="crm-public-form-item crm-group custom_post_profile-group">
299 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
302 {if $is_monetary and $form.bank_account_number}
303 <div id="payment_notice">
304 <fieldset class="crm-public-form-item crm-group payment_notice-group">
305 <legend>{ts}Agreement{/ts}</legend>
306 {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}
312 {include file='CRM/common/ReCAPTCHA.tpl'}
314 <div id="crm-submit-buttons" class="crm-submit-buttons">
315 {include file="CRM/common/formButtons.tpl" location="bottom"}
318 <div id="footer_text" class="crm-public-form-item crm-section contribution_footer_text-section">
319 <p>{$footer_text}</p>
323 <script type="text/javascript">
330 cj('input[name="soft_credit_type_id"]').on('change', function() {
334 function enableHonorType( ) {
335 var selectedValue = cj('input[name="soft_credit_type_id"]:checked');
336 if ( selectedValue.val() > 0) {
337 cj('#honorType').show();
340 cj('#honorType').hide();
344 cj('input[id="is_recur"]').on('change', function() {
348 function toggleRecur( ) {
349 var isRecur = cj('input[id="is_recur"]:checked');
350 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
351 var quickConfig = {/literal}{$quickConfig}{literal};
352 if ( allowAutoRenew && cj("#auto_renew") && quickConfig) {
353 showHideAutoRenew( null );
355 if (isRecur.val() > 0) {
356 cj('#recurHelp').show();
357 cj('#amount_sum_label').text('{/literal}{ts escape='js'}Regular amount{/ts}{literal}');
360 cj('#recurHelp').hide();
361 cj('#amount_sum_label').text('{/literal}{ts escape='js'}Total Amount{/ts}{literal}');
365 function pcpAnonymous( ) {
366 // clear nickname field if anonymous is true
367 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
368 document.getElementById('pcp_roll_nickname').value = '';
370 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
371 cj('#nickID').hide();
372 cj('#nameID').hide();
373 cj('#personalNoteID').hide();
376 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
377 cj('#nameID').show();
378 cj('#nickID').show();
379 cj('#personalNoteID').show();
382 cj('#nameID').show();
383 cj('#nickID').hide();
384 cj('#personalNoteID').hide();
396 // highlight price sets
397 function updatePriceSetHighlight() {
398 $('#priceset .price-set-row span').removeClass('highlight');
399 $('#priceset .price-set-row input:checked').parent().addClass('highlight');
401 $('#priceset input[type="radio"]').change(updatePriceSetHighlight);
402 updatePriceSetHighlight();
404 // Update pledge contribution amount when pledge checkboxes change
405 $("input[name^='pledge_amount']").on('change', function() {
407 $("input[name^='pledge_amount']:checked").each(function() {
408 total += Number($(this).attr('amount'));
410 $("input[name^='price_']").val(total.toFixed(2));
417 {* jQuery validate *}
418 {* disabled because more work needs to be done to conditionally require credit card fields *}
419 {*include file="CRM/Form/validate.tpl"*}