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: Load payment processor *}
28 {include file="CRM/Core/BillingBlock.tpl" context="front-end"}
29 <div id="paypalExpress">
30 {* Put PayPal Express button after customPost block since it's the submit button in this case. *}
31 {if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
32 {assign var=expressButtonName value='_qf_Register_upload_express'}
33 <fieldset class="crm-group payPalExpress-group">
34 <legend>{ts}Checkout with PayPal{/ts}</legend>
35 <div class="description">{ts}Click the PayPal button to continue.{/ts}</div>
36 <div>{$form.$expressButtonName.html} <span style="font-size:11px; font-family: Arial, Verdana;">Checkout securely. Pay without sharing your financial information. </span>
43 {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"}
46 {include file="CRM/common/TrackingFields.tpl"}
47 {capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture}
48 <div class="crm-event-id-{$event.id} crm-block crm-event-register-form-block">
50 {* moved to tpl since need to show only for primary participant page *}
51 {if $requireApprovalMsg || $waitlistMsg}
52 <div id="id-waitlist-approval-msg" class="messages status no-popup">
53 {if $requireApprovalMsg}
54 <div id="id-req-approval-msg">{$requireApprovalMsg}</div>
57 <div id="id-waitlist-msg">{$waitlistMsg}</div>
63 <div class="messages status no-popup" id="crm-event-register-different">
64 {ts 1=$display_name}Welcome %1{/ts}. (<a
65 href="{crmURL p='civicrm/event/register' q="cid=0&reset=1&id=`$event.id`"}"
66 title="{ts}Click here to register a different person for this event.{/ts}">{ts 1=$display_name}Not %1, or want to register a different person{/ts}</a>?)
69 {if $event.intro_text}
70 <div id="intro_text" class="crm-section intro_text-section">
71 <p>{$event.intro_text}</p>
74 {include file="CRM/common/cidzero.tpl"}
75 {if $pcpSupporterText}
76 <div class="crm-section pcpSupporterText-section">
77 <div class="content">{$pcpSupporterText}</div>
81 {if $form.additional_participants.html}
82 <div class="crm-section additional_participants-section" id="noOfparticipants">
83 <div class="label">{$form.additional_participants.label}</div>
85 {$form.additional_participants.html}{if $contact_id || $contact_id == NULL} ({ts}including yourself{/ts}){/if}
88 class="description">{ts}Fill in your registration information on this page. If you are registering additional people, you will be able to enter their registration information after you complete this page and click "Continue".{/ts}</span>
90 <div class="clear"></div>
95 {if ! $quickConfig}<fieldset id="priceset" class="crm-group priceset-group">
96 <legend>{$event.fee_label}</legend>{/if}
97 {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}
98 {include file="CRM/Price/Form/ParticipantCount.tpl"}
99 {if ! $quickConfig}</fieldset>{/if}
101 {if $form.is_pay_later}
102 <div class="crm-section pay_later-section">
103 <div class="label"> </div>
104 <div class="content">{$form.is_pay_later.html} {$form.is_pay_later.label}</div>
105 <div class="clear"></div>
109 {if $pcp && $is_honor_roll }
110 <fieldset class="crm-group pcp-group">
111 <div class="crm-section pcp-section">
112 <div class="crm-section display_in_roll-section">
113 <div class="content">
114 {$form.pcp_display_in_roll.html}
115 {$form.pcp_display_in_roll.label}
117 <div class="clear"></div>
119 <div id="nameID" class="crm-section is_anonymous-section">
120 <div class="content">
121 {$form.pcp_is_anonymous.html}
123 <div class="clear"></div>
125 <div id="nickID" class="crm-section pcp_roll_nickname-section">
126 <div class="label">{$form.pcp_roll_nickname.label}</div>
127 <div class="content">{$form.pcp_roll_nickname.html}
129 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>
131 <div class="clear"></div>
133 <div id="personalNoteID" class="crm-section pcp_personal_note-section">
134 <div class="label">{$form.pcp_personal_note.label}</div>
135 <div class="content">
136 {$form.pcp_personal_note.html}
137 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
139 <div class="clear"></div>
145 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
146 {include file="CRM/common/CMSUser.tpl"}
148 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
150 {if $form.payment_processor.label}
151 <fieldset class="crm-group payment_options-group" style="display:none;">
152 <legend>{ts}Payment Options{/ts}</legend>
153 <div class="crm-section payment_processor-section">
154 <div class="label">{$form.payment_processor.label}</div>
155 <div class="content">{$form.payment_processor.html}</div>
156 <div class="clear"></div>
161 <div id="billing-payment-block">
162 {* If we have a payment processor, load it - otherwise it happens via ajax *}
164 {include file="CRM/Event/Form/Registration/Register.tpl" snippet=4}
167 {include file="CRM/common/paymentBlock.tpl"}
169 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
172 {include file='CRM/common/ReCAPTCHA.tpl'}
175 <div id="crm-submit-buttons" class="crm-submit-buttons">
176 {include file="CRM/common/formButtons.tpl" location="bottom"}
179 {if $event.footer_text}
180 <div id="footer_text" class="crm-section event_footer_text-section">
181 <p>{$event.footer_text}</p>
185 <script type="text/javascript">
187 function toggleConfirmButton() {
188 var payPalExpressId = "{/literal}{$payPalExpressId}{literal}";
189 var elementObj = cj('input[name="payment_processor"]');
190 if (elementObj.attr('type') == 'hidden') {
191 var processorTypeId = elementObj.val();
194 var processorTypeId = elementObj.filter(':checked').val();
197 if (payPalExpressId != 0 && payPalExpressId == processorTypeId) {
198 cj("#crm-submit-buttons").hide();
201 cj("#crm-submit-buttons").show();
205 cj('input[name="payment_processor"]').change(function () {
206 toggleConfirmButton();
210 toggleConfirmButton();
214 function skipPaymentMethod() {
215 var symbol = '{/literal}{$currencySymbol}{literal}';
216 var isMultiple = '{/literal}{$event.is_multiple_registrations}{literal}';
219 if (isMultiple && cj("#additional_participants").val()) {
223 cj('#priceset input').change(function () {
224 if (((cj(this).attr('data-amount') == 0) || (cj('#pricevalue').text() == symbol + " 0.00" )) && flag ) {
225 cj(".payment_options-group").hide();
226 cj("div.payment_processor-section").hide();
227 cj("div#payment_information").hide();
230 cj(".payment_options-group").show();
231 cj("div.payment_processor-section").show();
232 cj("div#payment_information").show();
241 <script type="text/javascript">
242 {/literal}{if $pcp && $is_honor_roll }pcpAnonymous();
245 function allowParticipant() {
246 {/literal}{if $allowGroupOnWaitlist}{literal}
247 var additionalParticipants = cj('#additional_participants').val();
248 var pricesetParticipantCount = 0;
249 {/literal}{if $priceSet}{literal}
250 pricesetParticipantCount = pPartiCount;
251 {/literal}{/if}{literal}
253 allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount);
254 {/literal}{/if}{literal}
257 {/literal}{if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
259 showHidePayPalExpressOption();
260 {/literal}{/if}{literal}
262 function showHidePayPalExpressOption() {
263 var payLaterElement = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal};
264 if (( cj("#bypass_payment").val() == 1 ) ||
265 ( payLaterElement && document.getElementsByName('is_pay_later')[0].checked )) {
266 cj("#crm-submit-buttons").show();
267 cj("#paypalExpress").hide();
270 cj("#paypalExpress").show();
271 cj("#crm-submit-buttons").hide();
275 {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal}
276 showHidePaymentInfo();
277 {/literal} {/if}{literal}
279 function showHidePaymentInfo() {
280 var payLater = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal};
282 if (( cj("#bypass_payment").val() == 1 ) ||
283 ( payLater && document.getElementsByName('is_pay_later')[0].checked )) {
284 cj('#billing-payment-block').hide();
287 cj('#billing-payment-block').show();
291 {/literal}{if $allowGroupOnWaitlist}{literal}
292 allowGroupOnWaitlist(0, 0);
293 {/literal}{/if}{literal}
295 function allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount) {
296 {/literal}{if $isAdditionalParticipants}{literal}
297 if (!additionalParticipants) {
298 additionalParticipants = cj('#additional_participants').val();
300 {/literal}{else}{literal}
301 additionalParticipants = 0;
302 {/literal}{/if}{literal}
304 additionalParticipants = parseInt(additionalParticipants);
305 if (!additionalParticipants) {
306 additionalParticipants = 0;
309 var availableRegistrations = {/literal}'{$availableRegistrations}'{literal};
310 var totalParticipants = parseInt(additionalParticipants) + 1;
312 if (pricesetParticipantCount) {
313 // add priceset count if any
314 totalParticipants += parseInt(pricesetParticipantCount) - 1;
316 var isrequireApproval = {/literal}'{$requireApprovalMsg}'{literal};
318 if (totalParticipants > availableRegistrations) {
319 cj("#id-waitlist-msg").show();
320 cj("#id-waitlist-approval-msg").show();
322 //set the value for hidden bypass payment.
323 cj("#bypass_payment").val(1);
326 {/literal}{if $form.is_pay_later}{literal}
327 cj("#is-pay-later").hide();
328 {/literal} {/if}{literal}
332 if (isrequireApproval) {
333 cj("#id-waitlist-approval-msg").show();
334 cj("#id-waitlist-msg").hide();
337 cj("#id-waitlist-approval-msg").hide();
339 //reset value since user don't want or not eligible for waitlist
340 cj("#bypass_payment").val(0);
342 //need to show paylater if exists.
343 {/literal}{if $form.is_pay_later}{literal}
344 cj("#is-pay-later").show();
345 {/literal} {/if}{literal}
348 //now call showhide payment info.
350 {if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}{literal}
351 showHidePayPalExpressOption();
355 {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal}
356 showHidePaymentInfo();
357 {/literal}{/if}{literal}
360 {/literal}{if $pcp && $is_honor_roll }{literal}
361 function pcpAnonymous() {
362 // clear nickname field if anonymous is true
363 if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
364 document.getElementById('pcp_roll_nickname').value = '';
366 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
367 cj('#nickID, #nameID, #personalNoteID').hide();
370 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
371 cj('#nameID, #nickID, #personalNoteID').show();
374 cj('#nameID').show();
375 cj('#nickID, #personalNoteID').hide();
379 {/literal}{/if}{literal}