2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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)}
28 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl" context="front-end"}
32 <script type="text/javascript">
34 // Putting these functions directly in template so they are available for standalone forms
35 function useAmountOther() {
36 var priceset = {/literal}{if $contriPriceset}'{$contriPriceset}'{else}0{/if}{literal};
38 for( i=0; i < document.Main.elements.length; i++ ) {
39 element = document.Main.elements[i];
40 if ( element.type == 'radio' && element.name == priceset ) {
41 if (element.value == '0' ) {
45 element.checked = false;
51 function clearAmountOther() {
52 var priceset = {/literal}{if $priceset}'#{$priceset}'{else}0{/if}{literal}
57 if (document.Main.amount_other == null) return; // other_amt field not present; do nothing
58 document.Main.amount_other.value = "";
65 {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
68 {include file="CRM/common/TrackingFields.tpl"}
70 <div class="crm-contribution-page-id-{$contributionPageID} crm-block crm-contribution-main-form-block">
73 <div class="messages status no-popup crm-not-you-message">
74 {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>?)
78 <div id="intro_text" class="crm-section intro_text-section">
81 {include file="CRM/common/cidzero.tpl"}
82 {if $islifetime or $ispricelifetime }
83 <div id="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
86 {if !empty($useForMember)}
87 {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
89 <div id="priceset-div">
90 {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
95 {if $is_pledge_payment}
96 <div class="crm-section {$form.pledge_amount.name}-section">
97 <div class="label">{$form.pledge_amount.label} <span class="crm-marker">*</span></div>
98 <div class="content">{$form.pledge_amount.html}</div>
99 <div class="clear"></div>
102 <div class="crm-section {$form.is_pledge.name}-section">
103 <div class="label"> </div>
104 <div class="content">
105 {$form.is_pledge.html}
106 {if $is_pledge_interval}
107 {$form.pledge_frequency_interval.html}
109 {$form.pledge_frequency_unit.html}<span id="pledge_installments_num"> {ts}for{/ts} {$form.pledge_installments.html} {ts}installments.{/ts}</span>
111 <div class="clear"></div>
117 <div class="crm-section {$form.is_recur.name}-section">
118 <div class="label"> </div>
119 <div class="content">
120 {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
121 {if $is_recur_interval}
122 {$form.frequency_interval.html}
124 {if $one_frequency_unit}
127 {$form.frequency_unit.html}
129 {if $is_recur_installments}
130 <span id="recur_installments_num">
131 {ts}for{/ts} {$form.installments.html} {$form.installments.label}
134 <div id="recurHelp" class="description">
135 {ts}Your recurring contribution will be processed automatically.{/ts}
136 {if $is_recur_installments}
137 {ts}You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.{/ts}
139 {if $is_email_receipt}
140 {ts}You will receive an email receipt for each recurring contribution.{/ts}
144 <div class="clear"></div>
147 {if $pcpSupporterText}
148 <div class="crm-section pcpSupporterText-section">
149 <div class="label"> </div>
150 <div class="content">{$pcpSupporterText}</div>
151 <div class="clear"></div>
154 {assign var=n value=email-$bltID}
155 <div class="crm-section {$form.$n.name}-section">
156 <div class="label">{$form.$n.label}</div>
157 <div class="content">
160 <div class="clear"></div>
163 {if $form.is_for_organization}
164 <div class="crm-section {$form.is_for_organization.name}-section">
165 <div class="label"> </div>
166 <div class="content">
167 {$form.is_for_organization.html} {$form.is_for_organization.label}
169 <div class="clear"></div>
173 {if $is_for_organization}
174 <div id='onBehalfOfOrg' class="crm-section">
175 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl"}
179 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
180 {include file="CRM/common/CMSUser.tpl"}
181 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
183 {if $honor_block_is_active}
184 <fieldset class="crm-group honor_block-group">
185 {include file="CRM/Contribute/Form/SoftCredit.tpl"}
186 <div id="honorType" class="honoree-name-email-section">
187 {include file="CRM/UF/Form/Block.tpl" fields=$honoreeProfileFields mode=8 prefix='honor'}
192 <div class="crm-group custom_pre_profile-group">
193 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
197 <fieldset class="crm-group pcp-group">
198 <div class="crm-section pcp-section">
199 <div class="crm-section display_in_roll-section">
200 <div class="content">
201 {$form.pcp_display_in_roll.html}
202 {$form.pcp_display_in_roll.label}
204 <div class="clear"></div>
206 <div id="nameID" class="crm-section is_anonymous-section">
207 <div class="content">
208 {$form.pcp_is_anonymous.html}
210 <div class="clear"></div>
212 <div id="nickID" class="crm-section pcp_roll_nickname-section">
213 <div class="label">{$form.pcp_roll_nickname.label}</div>
214 <div class="content">{$form.pcp_roll_nickname.html}
215 <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>
217 <div class="clear"></div>
219 <div id="personalNoteID" class="crm-section pcp_personal_note-section">
220 <div class="label">{$form.pcp_personal_note.label}</div>
221 <div class="content">
222 {$form.pcp_personal_note.html}
223 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
225 <div class="clear"></div>
231 {if $form.payment_processor_id.label}
232 {* PP selection only works with JS enabled, so we hide it initially *}
233 <fieldset class="crm-group payment_options-group" style="display:none;">
234 <legend>{ts}Payment Options{/ts}</legend>
235 <div class="crm-section payment_processor-section">
236 <div class="label">{$form.payment_processor_id.label}</div>
237 <div class="content">{$form.payment_processor_id.html}</div>
238 <div class="clear"></div>
244 <fieldset class="crm-group pay_later-group">
245 <legend>{ts}Payment Options{/ts}</legend>
246 <div class="crm-section pay_later_receipt-section">
247 <div class="label"> </div>
248 <div class="content">
249 [x] {$pay_later_text}
251 <div class="clear"></div>
256 <div id="billing-payment-block">
257 {* If we have a payment processor, load it - otherwise it happens via ajax *}
258 {if $paymentProcessorID or $isBillingAddressRequiredForPayLater}
259 {include file="CRM/Financial/Form/Payment.tpl" snippet=4}
262 {include file="CRM/common/paymentBlock.tpl"}
264 <div class="crm-group custom_post_profile-group">
265 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
268 {if $is_monetary and $form.bank_account_number}
269 <div id="payment_notice">
270 <fieldset class="crm-group payment_notice-group">
271 <legend>{ts}Agreement{/ts}</legend>
272 {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}
278 {include file='CRM/common/ReCAPTCHA.tpl'}
280 <div id="crm-submit-buttons" class="crm-submit-buttons">
281 {include file="CRM/common/formButtons.tpl" location="bottom"}
284 <div id="footer_text" class="crm-section contribution_footer_text-section">
285 <p>{$footer_text}</p>
290 <script type="text/javascript">
296 if ({/literal}"{$form.is_recur}"{literal}) {
297 if (document.getElementsByName("is_recur")[0].checked == true) {
298 window.onload = function() {
304 function enablePeriod ( ) {
305 var frqInt = {/literal}"{$form.frequency_interval}"{literal};
306 if ( document.getElementsByName("is_recur")[0].checked == true ) {
307 //get back to auto renew settings.
308 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
309 if ( allowAutoRenew && cj("#auto_renew") ) {
310 showHideAutoRenew( null );
314 //disabled auto renew settings.
315 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
316 if ( allowAutoRenew && cj("#auto_renew") ) {
317 cj("#auto_renew").prop('checked', false );
318 cj('#allow_auto_renew').hide( );
324 {if $relatedOrganizationFound and $reset}
325 cj( "#is_for_organization" ).prop('checked', true );
327 {elseif $onBehalfRequired}
332 cj('input[name="soft_credit_type_id"]').on('change', function() {
336 function enableHonorType( ) {
337 var selectedValue = cj('input[name="soft_credit_type_id"]:checked');
338 if ( selectedValue.val() > 0) {
339 cj('#honorType').show();
342 cj('#honorType').hide();
346 cj('input[id="is_recur"]').on('change', function() {
350 function showRecurHelp( ) {
351 var showHelp = cj('input[id="is_recur"]:checked');
352 if ( showHelp.val() > 0) {
353 cj('#recurHelp').show();
356 cj('#recurHelp').hide();
360 function pcpAnonymous( ) {
361 // clear nickname field if anonymous is true
362 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
363 document.getElementById('pcp_roll_nickname').value = '';
365 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
366 cj('#nickID').hide();
367 cj('#nameID').hide();
368 cj('#personalNoteID').hide();
371 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
372 cj('#nameID').show();
373 cj('#nickID').show();
374 cj('#personalNoteID').show();
377 cj('#nameID').show();
378 cj('#nickID').hide();
379 cj('#personalNoteID').hide();
385 {if $form.is_pay_later and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
386 showHidePayPalExpressOption();
396 function showHidePayPalExpressOption() {
397 if (cj('input[name="is_pay_later"]').is(':checked')) {
398 cj("#crm-submit-buttons").show();
399 cj("#paypalExpress").hide();
402 cj("#paypalExpress").show();
403 cj("#crm-submit-buttons").hide();
407 function showHidePayment(flag) {
408 var payment_options = cj(".payment_options-group");
409 var payment_processor = cj("div.payment_processor-section");
410 var payment_information = cj("div#payment_information");
412 payment_options.hide();
413 payment_processor.hide();
414 payment_information.hide();
415 // also unset selected payment methods
416 cj('input[name="payment_processor"]').removeProp('checked');
419 payment_options.show();
420 payment_processor.show();
421 payment_information.show();
425 function skipPaymentMethod() {
427 cj('.price-set-option-content input[data-amount]').each( function(){
428 currentTotal = cj(this).attr('data-amount').replace(/[^\/\d]/g,'');
429 if( cj(this).is(':checked') && currentTotal == 0 ) {
434 cj('.price-set-option-content input[data-amount]').change( function () {
435 if (cj(this).attr('data-amount').replace(/[^\/\d]/g,'') == 0 ) {
440 showHidePayment(flag);
442 showHidePayment(flag);
446 // highlight price sets
447 function updatePriceSetHighlight() {
448 cj('#priceset .price-set-row span').removeClass('highlight');
449 cj('#priceset .price-set-row input:checked').parent().addClass('highlight');
451 cj('#priceset input[type="radio"]').change(updatePriceSetHighlight);
452 updatePriceSetHighlight();
454 function toggleBillingBlockIfFree(){
455 var total_amount_tmp = $(this).data('raw-total');
456 // Hide billing questions if this is free
457 if (total_amount_tmp == 0){
458 cj("#billing-payment-block").hide();
459 cj(".payment_options-group").hide();
462 cj("#billing-payment-block").show();
463 cj(".payment_options-group").show();
467 $('#pricevalue').each(toggleBillingBlockIfFree).on('change', toggleBillingBlockIfFree);
473 {* jQuery validate *}
474 {* disabled because more work needs to be done to conditionally require credit card fields *}
475 {*include file="CRM/Form/validate.tpl"*}