2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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 +--------------------------------------------------------------------+
27 {* Callback snippet: Load payment processor *}
29 {include file="CRM/Core/BillingBlock.tpl" context="front-end"}
31 {* Put PayPal Express button after customPost block since it's the submit button in this case. *}
32 {if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
33 <div id="paypalExpress">
34 {assign var=expressButtonName value='_qf_Main_upload_express'}
35 <fieldset class="crm-group paypal_checkout-group">
36 <legend>{ts}Checkout with PayPal{/ts}</legend>
38 <div class="crm-section paypalButtonInfo-section">
40 <span class="description">{ts}Click the PayPal button to continue.{/ts}</span>
42 <div class="clear"></div>
44 <div class="crm-section {$expressButtonName}-section">
46 {$form.$expressButtonName.html} <span class="description">Checkout securely. Pay without sharing your financial information. </span>
48 <div class="clear"></div>
59 <script type="text/javascript">
61 // Putting these functions directly in template so they are available for standalone forms
62 function useAmountOther() {
63 var priceset = {/literal}{if $contriPriceset}'{$contriPriceset}'{else}0{/if}{literal};
65 for( i=0; i < document.Main.elements.length; i++ ) {
66 element = document.Main.elements[i];
67 if ( element.type == 'radio' && element.name == priceset ) {
68 if (element.value == '0' ) {
72 element.checked = false;
78 function clearAmountOther() {
79 var priceset = {/literal}{if $priceset}'#{$priceset}'{else}0{/if}{literal}
84 if (document.Main.amount_other == null) return; // other_amt field not present; do nothing
85 document.Main.amount_other.value = "";
92 {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
95 {include file="CRM/common/TrackingFields.tpl"}
97 {capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture}
98 <div class="crm-contribution-page-id-{$contributionPageID} crm-block crm-contribution-main-form-block">
99 <div id="intro_text" class="crm-section intro_text-section">
102 {if $islifetime or $ispricelifetime }
103 <div id="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
106 {if !empty($useForMember)}
107 {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
109 <div id="priceset-div">
110 {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
115 {if $is_pledge_payment}
116 <div class="crm-section {$form.pledge_amount.name}-section">
117 <div class="label">{$form.pledge_amount.label} <span class="marker">*</span></div>
118 <div class="content">{$form.pledge_amount.html}</div>
119 <div class="clear"></div>
122 <div class="crm-section {$form.is_pledge.name}-section">
123 <div class="label"> </div>
124 <div class="content">
125 {$form.is_pledge.html}
126 {if $is_pledge_interval}
127 {$form.pledge_frequency_interval.html}
129 {$form.pledge_frequency_unit.html}<span id="pledge_installments_num"> {ts}for{/ts} {$form.pledge_installments.html} {ts}installments.{/ts}</span>
131 <div class="clear"></div>
137 <div class="crm-section {$form.is_recur.name}-section">
138 <div class="label"> </div>
139 <div class="content">
140 {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
141 {if $is_recur_interval}
142 {$form.frequency_interval.html}
144 {if $one_frequency_unit}
147 {$form.frequency_unit.html}
149 {if $is_recur_installments}
150 {ts}for{/ts} {$form.installments.html} {$form.installments.label}
153 <div class="clear"></div>
156 {if $pcpSupporterText}
157 <div class="crm-section pcpSupporterText-section">
158 <div class="label"> </div>
159 <div class="content">{$pcpSupporterText}</div>
160 <div class="clear"></div>
163 {assign var=n value=email-$bltID}
164 <div class="crm-section {$form.$n.name}-section">
165 <div class="label">{$form.$n.label}</div>
166 <div class="content">
169 <div class="clear"></div>
172 {if $form.is_for_organization}
173 <div class="crm-section {$form.is_for_organization.name}-section">
174 <div class="label"> </div>
175 <div class="content">
176 {$form.is_for_organization.html} {$form.is_for_organization.label}
178 <div class="clear"></div>
182 {if $is_for_organization}
183 <div id='onBehalfOfOrg' class="crm-section">
184 {include file=CRM/Contribute/Form/Contribution/OnBehalfOf.tpl}
188 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
189 {include file="CRM/common/CMSUser.tpl"}
190 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
192 {if $honor_block_is_active}
193 <fieldset class="crm-group honor_block-group">
194 <legend>{$honor_block_title}</legend>
195 <div class="crm-section honor_block_text-section">
198 {if $form.honor_type_id.html}
199 <div class="crm-section {$form.honor_type_id.name}-section">
200 <div class="content" >
201 {$form.honor_type_id.html}
202 <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('honor_type_id', '{$form.formName}');enableHonorType(); return false;">{ts}clear{/ts}</a>)</span>
203 <div class="description">{ts}Select an option to reveal honoree information fields.{/ts}</div>
207 <div id="honorType" class="honoree-name-email-section">
208 <div class="crm-section {$form.honor_prefix_id.name}-section">
209 <div class="content">{$form.honor_prefix_id.html}</div>
211 <div class="crm-section {$form.honor_first_name.name}-section">
212 <div class="label">{$form.honor_first_name.label}</div>
213 <div class="content">
214 {$form.honor_first_name.html}
216 <div class="clear"></div>
218 <div class="crm-section {$form.honor_last_name.name}-section">
219 <div class="label">{$form.honor_last_name.label}</div>
220 <div class="content">
221 {$form.honor_last_name.html}
223 <div class="clear"></div>
225 <div id="honorTypeEmail" class="crm-section {$form.honor_email.name}-section">
226 <div class="label">{$form.honor_email.label}</div>
227 <div class="content">
228 {$form.honor_email.html}
230 <div class="clear"></div>
236 <div class="crm-group custom_pre_profile-group">
237 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
241 <fieldset class="crm-group pcp-group">
242 <div class="crm-section pcp-section">
243 <div class="crm-section display_in_roll-section">
244 <div class="content">
245 {$form.pcp_display_in_roll.html}
246 {$form.pcp_display_in_roll.label}
248 <div class="clear"></div>
250 <div id="nameID" class="crm-section is_anonymous-section">
251 <div class="content">
252 {$form.pcp_is_anonymous.html}
254 <div class="clear"></div>
256 <div id="nickID" class="crm-section pcp_roll_nickname-section">
257 <div class="label">{$form.pcp_roll_nickname.label}</div>
258 <div class="content">{$form.pcp_roll_nickname.html}
259 <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>
261 <div class="clear"></div>
263 <div id="personalNoteID" class="crm-section pcp_personal_note-section">
264 <div class="label">{$form.pcp_personal_note.label}</div>
265 <div class="content">
266 {$form.pcp_personal_note.html}
267 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
269 <div class="clear"></div>
275 {if $form.payment_processor.label}
276 {* PP selection only works with JS enabled, so we hide it initially *}
277 <fieldset class="crm-group payment_options-group" style="display:none;">
278 <legend>{ts}Payment Options{/ts}</legend>
279 <div class="crm-section payment_processor-section">
280 <div class="label">{$form.payment_processor.label}</div>
281 <div class="content">{$form.payment_processor.html}</div>
282 <div class="clear"></div>
288 <fieldset class="crm-group pay_later-group">
289 <legend>{ts}Payment Options{/ts}</legend>
290 <div class="crm-section pay_later_receipt-section">
291 <div class="label"> </div>
292 <div class="content">
293 [x] {$pay_later_text}
295 <div class="clear"></div>
300 <div id="billing-payment-block">
301 {* If we have a payment processor, load it - otherwise it happens via ajax *}
303 {include file="CRM/Contribute/Form/Contribution/Main.tpl" snippet=4}
306 {include file="CRM/common/paymentBlock.tpl"}
308 <div class="crm-group custom_post_profile-group">
309 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
312 {if $is_monetary and $form.bank_account_number}
313 <div id="payment_notice">
314 <fieldset class="crm-group payment_notice-group">
315 <legend>{ts}Agreement{/ts}</legend>
316 {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}
322 {include file='CRM/common/ReCAPTCHA.tpl'}
324 <div id="crm-submit-buttons" class="crm-submit-buttons">
325 {include file="CRM/common/formButtons.tpl" location="bottom"}
328 <div id="footer_text" class="crm-section contribution_footer_text-section">
329 <p>{$footer_text}</p>
334 <script type="text/javascript">
340 if ({/literal}"{$form.is_recur}"{literal}) {
341 if (document.getElementsByName("is_recur")[0].checked == true) {
342 window.onload = function() {
348 function enablePeriod ( ) {
349 var frqInt = {/literal}"{$form.frequency_interval}"{literal};
350 if ( document.getElementsByName("is_recur")[0].checked == true ) {
351 //get back to auto renew settings.
352 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
353 if ( allowAutoRenew && cj("#auto_renew") ) {
354 showHideAutoRenew( null );
358 //disabled auto renew settings.
359 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
360 if ( allowAutoRenew && cj("#auto_renew") ) {
361 cj("#auto_renew").attr( 'checked', false );
362 cj('#allow_auto_renew').hide( );
368 {if $relatedOrganizationFound and $reset}
369 cj( "#is_for_organization" ).attr( 'checked', true );
371 {elseif $onBehalfRequired}
375 {if $honor_block_is_active AND $form.honor_type_id.html}
380 function enableHonorType( ) {
381 var element = document.getElementsByName("honor_type_id");
382 for (var i = 0; i < element.length; i++ ) {
384 if ( element[i].checked == true ) {
390 cj('#honorType').show();
391 cj('#honorTypeEmail').show();
394 document.getElementById('honor_first_name').value = '';
395 document.getElementById('honor_last_name').value = '';
396 document.getElementById('honor_email').value = '';
397 document.getElementById('honor_prefix_id').value = '';
398 cj('#honorType').hide();
399 cj('#honorTypeEmail').hide();
403 function pcpAnonymous( ) {
404 // clear nickname field if anonymous is true
405 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
406 document.getElementById('pcp_roll_nickname').value = '';
408 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
409 cj('#nickID').hide();
410 cj('#nameID').hide();
411 cj('#personalNoteID').hide();
414 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
415 cj('#nameID').show();
416 cj('#nickID').show();
417 cj('#personalNoteID').show();
420 cj('#nameID').show();
421 cj('#nickID').hide();
422 cj('#personalNoteID').hide();
428 {if $form.is_pay_later and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
429 showHidePayPalExpressOption();
433 function toggleConfirmButton() {
434 var payPalExpressId = "{/literal}{$payPalExpressId}{literal}";
435 var elementObj = cj('input[name="payment_processor"]');
436 if ( elementObj.attr('type') == 'hidden' ) {
437 var processorTypeId = elementObj.val( );
440 var processorTypeId = elementObj.filter(':checked').val();
443 if (payPalExpressId !=0 && payPalExpressId == processorTypeId) {
444 cj("#crm-submit-buttons").hide();
447 cj("#crm-submit-buttons").show();
451 cj('input[name="payment_processor"]').change( function() {
452 toggleConfirmButton();
456 toggleConfirmButton();
459 function showHidePayPalExpressOption() {
460 if (cj('input[name="is_pay_later"]').is(':checked')) {
461 cj("#crm-submit-buttons").show();
462 cj("#paypalExpress").hide();
465 cj("#paypalExpress").show();
466 cj("#crm-submit-buttons").hide();
471 // highlight price sets
472 function updatePriceSetHighlight() {
473 cj('#priceset .price-set-row').removeClass('highlight');
474 cj('#priceset .price-set-row input:checked').parent().parent().addClass('highlight');
476 cj('#priceset input[type="radio"]').change(updatePriceSetHighlight);
477 updatePriceSetHighlight();
483 {* jQuery validate *}
484 {* disabled because more work needs to be done to conditionally require credit card fields *}
485 {*include file="CRM/Form/validate.tpl"*}