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 {include file="CRM/common/cidzero.tpl"}
103 {if $islifetime or $ispricelifetime }
104 <div id="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
107 {if !empty($useForMember)}
108 {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
110 <div id="priceset-div">
111 {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
116 {if $is_pledge_payment}
117 <div class="crm-section {$form.pledge_amount.name}-section">
118 <div class="label">{$form.pledge_amount.label} <span class="marker">*</span></div>
119 <div class="content">{$form.pledge_amount.html}</div>
120 <div class="clear"></div>
123 <div class="crm-section {$form.is_pledge.name}-section">
124 <div class="label"> </div>
125 <div class="content">
126 {$form.is_pledge.html}
127 {if $is_pledge_interval}
128 {$form.pledge_frequency_interval.html}
130 {$form.pledge_frequency_unit.html}<span id="pledge_installments_num"> {ts}for{/ts} {$form.pledge_installments.html} {ts}installments.{/ts}</span>
132 <div class="clear"></div>
138 <div class="crm-section {$form.is_recur.name}-section">
139 <div class="label"> </div>
140 <div class="content">
141 {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
142 {if $is_recur_interval}
143 {$form.frequency_interval.html}
145 {if $one_frequency_unit}
148 {$form.frequency_unit.html}
150 {if $is_recur_installments}
151 {ts}for{/ts} {$form.installments.html} {$form.installments.label}
154 <div class="clear"></div>
157 {if $pcpSupporterText}
158 <div class="crm-section pcpSupporterText-section">
159 <div class="label"> </div>
160 <div class="content">{$pcpSupporterText}</div>
161 <div class="clear"></div>
164 {assign var=n value=email-$bltID}
165 <div class="crm-section {$form.$n.name}-section">
166 <div class="label">{$form.$n.label}</div>
167 <div class="content">
170 <div class="clear"></div>
173 {if $form.is_for_organization}
174 <div class="crm-section {$form.is_for_organization.name}-section">
175 <div class="label"> </div>
176 <div class="content">
177 {$form.is_for_organization.html} {$form.is_for_organization.label}
179 <div class="clear"></div>
183 {if $is_for_organization}
184 <div id='onBehalfOfOrg' class="crm-section">
185 {include file=CRM/Contribute/Form/Contribution/OnBehalfOf.tpl}
189 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
190 {include file="CRM/common/CMSUser.tpl"}
191 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
193 {if $honor_block_is_active}
194 <fieldset class="crm-group honor_block-group">
195 <legend>{$honor_block_title}</legend>
196 <div class="crm-section honor_block_text-section">
199 {if $form.honor_type_id.html}
200 <div class="crm-section {$form.honor_type_id.name}-section">
201 <div class="content" >
202 {$form.honor_type_id.html}
203 <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('honor_type_id', '{$form.formName}');enableHonorType(); return false;">{ts}clear{/ts}</a>)</span>
204 <div class="description">{ts}Select an option to reveal honoree information fields.{/ts}</div>
208 <div id="honorType" class="honoree-name-email-section">
209 <div class="crm-section {$form.honor_prefix_id.name}-section">
210 <div class="content">{$form.honor_prefix_id.html}</div>
212 <div class="crm-section {$form.honor_first_name.name}-section">
213 <div class="label">{$form.honor_first_name.label}</div>
214 <div class="content">
215 {$form.honor_first_name.html}
217 <div class="clear"></div>
219 <div class="crm-section {$form.honor_last_name.name}-section">
220 <div class="label">{$form.honor_last_name.label}</div>
221 <div class="content">
222 {$form.honor_last_name.html}
224 <div class="clear"></div>
226 <div id="honorTypeEmail" class="crm-section {$form.honor_email.name}-section">
227 <div class="label">{$form.honor_email.label}</div>
228 <div class="content">
229 {$form.honor_email.html}
231 <div class="clear"></div>
237 <div class="crm-group custom_pre_profile-group">
238 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
242 <fieldset class="crm-group pcp-group">
243 <div class="crm-section pcp-section">
244 <div class="crm-section display_in_roll-section">
245 <div class="content">
246 {$form.pcp_display_in_roll.html}
247 {$form.pcp_display_in_roll.label}
249 <div class="clear"></div>
251 <div id="nameID" class="crm-section is_anonymous-section">
252 <div class="content">
253 {$form.pcp_is_anonymous.html}
255 <div class="clear"></div>
257 <div id="nickID" class="crm-section pcp_roll_nickname-section">
258 <div class="label">{$form.pcp_roll_nickname.label}</div>
259 <div class="content">{$form.pcp_roll_nickname.html}
260 <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>
262 <div class="clear"></div>
264 <div id="personalNoteID" class="crm-section pcp_personal_note-section">
265 <div class="label">{$form.pcp_personal_note.label}</div>
266 <div class="content">
267 {$form.pcp_personal_note.html}
268 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
270 <div class="clear"></div>
276 {if $form.payment_processor.label}
277 {* PP selection only works with JS enabled, so we hide it initially *}
278 <fieldset class="crm-group payment_options-group" style="display:none;">
279 <legend>{ts}Payment Options{/ts}</legend>
280 <div class="crm-section payment_processor-section">
281 <div class="label">{$form.payment_processor.label}</div>
282 <div class="content">{$form.payment_processor.html}</div>
283 <div class="clear"></div>
289 <fieldset class="crm-group pay_later-group">
290 <legend>{ts}Payment Options{/ts}</legend>
291 <div class="crm-section pay_later_receipt-section">
292 <div class="label"> </div>
293 <div class="content">
294 [x] {$pay_later_text}
296 <div class="clear"></div>
301 <div id="billing-payment-block">
302 {* If we have a payment processor, load it - otherwise it happens via ajax *}
304 {include file="CRM/Contribute/Form/Contribution/Main.tpl" snippet=4}
307 {include file="CRM/common/paymentBlock.tpl"}
309 <div class="crm-group custom_post_profile-group">
310 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
313 {if $is_monetary and $form.bank_account_number}
314 <div id="payment_notice">
315 <fieldset class="crm-group payment_notice-group">
316 <legend>{ts}Agreement{/ts}</legend>
317 {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}
323 {include file='CRM/common/ReCAPTCHA.tpl'}
325 <div id="crm-submit-buttons" class="crm-submit-buttons">
326 {include file="CRM/common/formButtons.tpl" location="bottom"}
329 <div id="footer_text" class="crm-section contribution_footer_text-section">
330 <p>{$footer_text}</p>
335 <script type="text/javascript">
341 if ({/literal}"{$form.is_recur}"{literal}) {
342 if (document.getElementsByName("is_recur")[0].checked == true) {
343 window.onload = function() {
349 function enablePeriod ( ) {
350 var frqInt = {/literal}"{$form.frequency_interval}"{literal};
351 if ( document.getElementsByName("is_recur")[0].checked == true ) {
352 //get back to auto renew settings.
353 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
354 if ( allowAutoRenew && cj("#auto_renew") ) {
355 showHideAutoRenew( null );
359 //disabled auto renew settings.
360 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
361 if ( allowAutoRenew && cj("#auto_renew") ) {
362 cj("#auto_renew").attr( 'checked', false );
363 cj('#allow_auto_renew').hide( );
369 {if $relatedOrganizationFound and $reset}
370 cj( "#is_for_organization" ).attr( 'checked', true );
372 {elseif $onBehalfRequired}
376 {if $honor_block_is_active AND $form.honor_type_id.html}
381 function enableHonorType( ) {
382 var element = document.getElementsByName("honor_type_id");
383 for (var i = 0; i < element.length; i++ ) {
385 if ( element[i].checked == true ) {
391 cj('#honorType').show();
392 cj('#honorTypeEmail').show();
395 document.getElementById('honor_first_name').value = '';
396 document.getElementById('honor_last_name').value = '';
397 document.getElementById('honor_email').value = '';
398 document.getElementById('honor_prefix_id').value = '';
399 cj('#honorType').hide();
400 cj('#honorTypeEmail').hide();
404 function pcpAnonymous( ) {
405 // clear nickname field if anonymous is true
406 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
407 document.getElementById('pcp_roll_nickname').value = '';
409 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
410 cj('#nickID').hide();
411 cj('#nameID').hide();
412 cj('#personalNoteID').hide();
415 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
416 cj('#nameID').show();
417 cj('#nickID').show();
418 cj('#personalNoteID').show();
421 cj('#nameID').show();
422 cj('#nickID').hide();
423 cj('#personalNoteID').hide();
429 {if $form.is_pay_later and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
430 showHidePayPalExpressOption();
434 function toggleConfirmButton() {
435 var payPalExpressId = "{/literal}{$payPalExpressId}{literal}";
436 var elementObj = cj('input[name="payment_processor"]');
437 if ( elementObj.attr('type') == 'hidden' ) {
438 var processorTypeId = elementObj.val( );
441 var processorTypeId = elementObj.filter(':checked').val();
444 if (payPalExpressId !=0 && payPalExpressId == processorTypeId) {
445 cj("#crm-submit-buttons").hide();
448 cj("#crm-submit-buttons").show();
452 cj('input[name="payment_processor"]').change( function() {
453 toggleConfirmButton();
457 toggleConfirmButton();
460 function showHidePayPalExpressOption() {
461 if (cj('input[name="is_pay_later"]').is(':checked')) {
462 cj("#crm-submit-buttons").show();
463 cj("#paypalExpress").hide();
466 cj("#paypalExpress").show();
467 cj("#crm-submit-buttons").hide();
472 // highlight price sets
473 function updatePriceSetHighlight() {
474 cj('#priceset .price-set-row').removeClass('highlight');
475 cj('#priceset .price-set-row input:checked').parent().parent().addClass('highlight');
477 cj('#priceset input[type="radio"]').change(updatePriceSetHighlight);
478 updatePriceSetHighlight();
484 {* jQuery validate *}
485 {* disabled because more work needs to be done to conditionally require credit card fields *}
486 {*include file="CRM/Form/validate.tpl"*}