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 +--------------------------------------------------------------------+
26 {* Callback snippet: On-behalf profile *}
27 {if $snippet and !empty($isOnBehalfCallback)}
28 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl" context="front-end"}
30 {* Callback snippet: Load payment processor *}
32 {include file="CRM/Core/BillingBlock.tpl" context="front-end"}
34 {* Put PayPal Express button after customPost block since it's the submit button in this case. *}
35 {if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
36 <div id="paypalExpress">
37 {assign var=expressButtonName value='_qf_Main_upload_express'}
38 <fieldset class="crm-group paypal_checkout-group">
39 <legend>{ts}Checkout with PayPal{/ts}</legend>
41 <div class="crm-section paypalButtonInfo-section">
43 <span class="description">{ts}Click the PayPal button to continue.{/ts}</span>
45 <div class="clear"></div>
47 <div class="crm-section {$expressButtonName}-section">
49 {$form.$expressButtonName.html} <span class="description">Checkout securely. Pay without sharing your financial information. </span>
51 <div class="clear"></div>
62 <script type="text/javascript">
64 // Putting these functions directly in template so they are available for standalone forms
65 function useAmountOther() {
66 var priceset = {/literal}{if $contriPriceset}'{$contriPriceset}'{else}0{/if}{literal};
68 for( i=0; i < document.Main.elements.length; i++ ) {
69 element = document.Main.elements[i];
70 if ( element.type == 'radio' && element.name == priceset ) {
71 if (element.value == '0' ) {
75 element.checked = false;
81 function clearAmountOther() {
82 var priceset = {/literal}{if $priceset}'#{$priceset}'{else}0{/if}{literal}
87 if (document.Main.amount_other == null) return; // other_amt field not present; do nothing
88 document.Main.amount_other.value = "";
95 {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
98 {include file="CRM/common/TrackingFields.tpl"}
100 {capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture}
101 <div class="crm-contribution-page-id-{$contributionPageID} crm-block crm-contribution-main-form-block">
102 <div id="intro_text" class="crm-section intro_text-section">
105 {include file="CRM/common/cidzero.tpl"}
106 {if $islifetime or $ispricelifetime }
107 <div id="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
110 {if !empty($useForMember)}
111 {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
113 <div id="priceset-div">
114 {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
119 {if $is_pledge_payment}
120 <div class="crm-section {$form.pledge_amount.name}-section">
121 <div class="label">{$form.pledge_amount.label} <span class="marker">*</span></div>
122 <div class="content">{$form.pledge_amount.html}</div>
123 <div class="clear"></div>
126 <div class="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>
141 <div class="crm-section {$form.is_recur.name}-section">
142 <div class="label"> </div>
143 <div class="content">
144 {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
145 {if $is_recur_interval}
146 {$form.frequency_interval.html}
148 {if $one_frequency_unit}
151 {$form.frequency_unit.html}
153 {if $is_recur_installments}
154 {ts}for{/ts} {$form.installments.html} {$form.installments.label}
157 <div class="clear"></div>
160 {if $pcpSupporterText}
161 <div class="crm-section pcpSupporterText-section">
162 <div class="label"> </div>
163 <div class="content">{$pcpSupporterText}</div>
164 <div class="clear"></div>
167 {assign var=n value=email-$bltID}
168 <div class="crm-section {$form.$n.name}-section">
169 <div class="label">{$form.$n.label}</div>
170 <div class="content">
173 <div class="clear"></div>
176 {if $form.is_for_organization}
177 <div class="crm-section {$form.is_for_organization.name}-section">
178 <div class="label"> </div>
179 <div class="content">
180 {$form.is_for_organization.html} {$form.is_for_organization.label}
182 <div class="clear"></div>
186 {if $is_for_organization}
187 <div id='onBehalfOfOrg' class="crm-section">
188 {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl"}
192 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
193 {include file="CRM/common/CMSUser.tpl"}
194 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
196 {if $honor_block_is_active}
197 <fieldset class="crm-group honor_block-group">
198 <legend>{$honor_block_title}</legend>
199 <div class="crm-section honor_block_text-section">
202 {if $form.honor_type_id.html}
203 <div class="crm-section {$form.honor_type_id.name}-section">
204 <div class="content" >
205 {$form.honor_type_id.html}
206 <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('honor_type_id', '{$form.formName}');enableHonorType(); return false;">{ts}clear{/ts}</a>)</span>
207 <div class="description">{ts}Select an option to reveal honoree information fields.{/ts}</div>
211 <div id="honorType" class="honoree-name-email-section">
212 <div class="crm-section {$form.honor_prefix_id.name}-section">
213 <div class="content">{$form.honor_prefix_id.html}</div>
215 <div class="crm-section {$form.honor_first_name.name}-section">
216 <div class="label">{$form.honor_first_name.label}</div>
217 <div class="content">
218 {$form.honor_first_name.html}
220 <div class="clear"></div>
222 <div class="crm-section {$form.honor_last_name.name}-section">
223 <div class="label">{$form.honor_last_name.label}</div>
224 <div class="content">
225 {$form.honor_last_name.html}
227 <div class="clear"></div>
229 <div id="honorTypeEmail" class="crm-section {$form.honor_email.name}-section">
230 <div class="label">{$form.honor_email.label}</div>
231 <div class="content">
232 {$form.honor_email.html}
234 <div class="clear"></div>
240 <div class="crm-group custom_pre_profile-group">
241 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
245 <fieldset class="crm-group pcp-group">
246 <div class="crm-section pcp-section">
247 <div class="crm-section display_in_roll-section">
248 <div class="content">
249 {$form.pcp_display_in_roll.html}
250 {$form.pcp_display_in_roll.label}
252 <div class="clear"></div>
254 <div id="nameID" class="crm-section is_anonymous-section">
255 <div class="content">
256 {$form.pcp_is_anonymous.html}
258 <div class="clear"></div>
260 <div id="nickID" class="crm-section pcp_roll_nickname-section">
261 <div class="label">{$form.pcp_roll_nickname.label}</div>
262 <div class="content">{$form.pcp_roll_nickname.html}
263 <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>
265 <div class="clear"></div>
267 <div id="personalNoteID" class="crm-section pcp_personal_note-section">
268 <div class="label">{$form.pcp_personal_note.label}</div>
269 <div class="content">
270 {$form.pcp_personal_note.html}
271 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
273 <div class="clear"></div>
279 {if $form.payment_processor.label}
280 {* PP selection only works with JS enabled, so we hide it initially *}
281 <fieldset class="crm-group payment_options-group" style="display:none;">
282 <legend>{ts}Payment Options{/ts}</legend>
283 <div class="crm-section payment_processor-section">
284 <div class="label">{$form.payment_processor.label}</div>
285 <div class="content">{$form.payment_processor.html}</div>
286 <div class="clear"></div>
292 <fieldset class="crm-group pay_later-group">
293 <legend>{ts}Payment Options{/ts}</legend>
294 <div class="crm-section pay_later_receipt-section">
295 <div class="label"> </div>
296 <div class="content">
297 [x] {$pay_later_text}
299 <div class="clear"></div>
304 <div id="billing-payment-block">
305 {* If we have a payment processor, load it - otherwise it happens via ajax *}
307 {include file="CRM/Contribute/Form/Contribution/Main.tpl" snippet=4}
310 {include file="CRM/common/paymentBlock.tpl"}
312 <div class="crm-group custom_post_profile-group">
313 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
316 {if $is_monetary and $form.bank_account_number}
317 <div id="payment_notice">
318 <fieldset class="crm-group payment_notice-group">
319 <legend>{ts}Agreement{/ts}</legend>
320 {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}
326 {include file='CRM/common/ReCAPTCHA.tpl'}
328 <div id="crm-submit-buttons" class="crm-submit-buttons">
329 {include file="CRM/common/formButtons.tpl" location="bottom"}
332 <div id="footer_text" class="crm-section contribution_footer_text-section">
333 <p>{$footer_text}</p>
338 <script type="text/javascript">
344 if ({/literal}"{$form.is_recur}"{literal}) {
345 if (document.getElementsByName("is_recur")[0].checked == true) {
346 window.onload = function() {
352 function enablePeriod ( ) {
353 var frqInt = {/literal}"{$form.frequency_interval}"{literal};
354 if ( document.getElementsByName("is_recur")[0].checked == true ) {
355 //get back to auto renew settings.
356 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
357 if ( allowAutoRenew && cj("#auto_renew") ) {
358 showHideAutoRenew( null );
362 //disabled auto renew settings.
363 var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
364 if ( allowAutoRenew && cj("#auto_renew") ) {
365 cj("#auto_renew").attr( 'checked', false );
366 cj('#allow_auto_renew').hide( );
372 {if $relatedOrganizationFound and $reset}
373 cj( "#is_for_organization" ).attr( 'checked', true );
375 {elseif $onBehalfRequired}
379 {if $honor_block_is_active AND $form.honor_type_id.html}
384 function enableHonorType( ) {
385 var element = document.getElementsByName("honor_type_id");
386 for (var i = 0; i < element.length; i++ ) {
388 if ( element[i].checked == true ) {
394 cj('#honorType').show();
395 cj('#honorTypeEmail').show();
398 document.getElementById('honor_first_name').value = '';
399 document.getElementById('honor_last_name').value = '';
400 document.getElementById('honor_email').value = '';
401 document.getElementById('honor_prefix_id').value = '';
402 cj('#honorType').hide();
403 cj('#honorTypeEmail').hide();
407 function pcpAnonymous( ) {
408 // clear nickname field if anonymous is true
409 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
410 document.getElementById('pcp_roll_nickname').value = '';
412 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
413 cj('#nickID').hide();
414 cj('#nameID').hide();
415 cj('#personalNoteID').hide();
418 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
419 cj('#nameID').show();
420 cj('#nickID').show();
421 cj('#personalNoteID').show();
424 cj('#nameID').show();
425 cj('#nickID').hide();
426 cj('#personalNoteID').hide();
432 {if $form.is_pay_later and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
433 showHidePayPalExpressOption();
437 function toggleConfirmButton() {
438 var payPalExpressId = "{/literal}{$payPalExpressId}{literal}";
439 var elementObj = cj('input[name="payment_processor"]');
440 if ( elementObj.attr('type') == 'hidden' ) {
441 var processorTypeId = elementObj.val( );
444 var processorTypeId = elementObj.filter(':checked').val();
447 if (payPalExpressId !=0 && payPalExpressId == processorTypeId) {
448 cj("#crm-submit-buttons").hide();
451 cj("#crm-submit-buttons").show();
455 cj('input[name="payment_processor"]').change( function() {
456 toggleConfirmButton();
460 toggleConfirmButton();
463 function showHidePayPalExpressOption() {
464 if (cj('input[name="is_pay_later"]').is(':checked')) {
465 cj("#crm-submit-buttons").show();
466 cj("#paypalExpress").hide();
469 cj("#paypalExpress").show();
470 cj("#crm-submit-buttons").hide();
475 // highlight price sets
476 function updatePriceSetHighlight() {
477 cj('#priceset .price-set-row').removeClass('highlight');
478 cj('#priceset .price-set-row input:checked').parent().parent().addClass('highlight');
480 cj('#priceset input[type="radio"]').change(updatePriceSetHighlight);
481 updatePriceSetHighlight();
487 {* jQuery validate *}
488 {* disabled because more work needs to be done to conditionally require credit card fields *}
489 {*include file="CRM/Form/validate.tpl"*}