commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / templates / CRM / Event / Form / Registration / Register.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
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. |
12 | |
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. |
17 | |
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 +--------------------------------------------------------------------+
25 *}
26 {* Callback snippet: Load payment processor *}
27 {if $snippet}
28 {include file="CRM/Core/BillingBlock.tpl"}
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-public-form-item 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>
37 </div>
38 </fieldset>
39 {/if}
40 </div>
41 {else}
42 {if $action & 1024}
43 {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"}
44 {/if}
45
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">
49
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>
55 {/if}
56 {if $waitlistMsg}
57 <div id="id-waitlist-msg">{$waitlistMsg}</div>
58 {/if}
59 </div>
60 {/if}
61
62 {if $contact_id}
63 <div class="messages status no-popup crm-not-you-message" 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>?)
67 </div>
68 {/if}
69 {if $event.intro_text}
70 <div id="intro_text" class="crm-public-form-item crm-section intro_text-section">
71 <p>{$event.intro_text}</p>
72 </div>
73 {/if}
74
75 {include file="CRM/common/cidzero.tpl"}
76 {if $pcpSupporterText}
77 <div class="crm-public-form-item crm-section pcpSupporterText-section">
78 <div class="content">{$pcpSupporterText}</div>
79 </div>
80 {/if}
81
82 {if $form.additional_participants.html}
83 <div class="crm-public-form-item crm-section additional_participants-section" id="noOfparticipants">
84 <div class="label">{$form.additional_participants.label}</div>
85 <div class="content">
86 {$form.additional_participants.html}{if $contact_id || $contact_id == NULL} &nbsp; ({ts}including yourself{/ts}){/if}
87 <br/>
88 <span
89 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 &quot;Continue&quot;.{/ts}</span>
90 </div>
91 <div class="clear"></div>
92 </div>
93 {/if}
94
95 <div class="crm-public-form-item crm-section cms_user-section">
96 {* User account registration option. Displays if enabled for one of the profiles on this page. *}
97 {include file="CRM/common/CMSUser.tpl"}
98 </div>
99
100 <div class="crm-public-form-item crm-section custom_pre-section">
101 {* Display "Top of page" profile immediately after the introductory text *}
102 {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
103 </div>
104
105 {if $priceSet}
106 {if ! $quickConfig}<fieldset id="priceset" class="crm-public-form-item crm-group priceset-group">
107 <legend>{$event.fee_label}</legend>{/if}
108 {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}
109 {include file="CRM/Price/Form/ParticipantCount.tpl"}
110 {if ! $quickConfig}</fieldset>{/if}
111 {/if}
112 {if $pcp && $is_honor_roll }
113 <fieldset class="crm-public-form-item crm-group pcp-group">
114 <div class="crm-public-form-item crm-section pcp-section">
115 <div class="crm-public-form-item crm-section display_in_roll-section">
116 <div class="content">
117 {$form.pcp_display_in_roll.html} &nbsp;
118 {$form.pcp_display_in_roll.label}
119 </div>
120 <div class="clear"></div>
121 </div>
122 <div id="nameID" class="crm-public-form-item crm-section is_anonymous-section">
123 <div class="content">
124 {$form.pcp_is_anonymous.html}
125 </div>
126 <div class="clear"></div>
127 </div>
128 <div id="nickID" class="crm-public-form-item crm-section pcp_roll_nickname-section">
129 <div class="label">{$form.pcp_roll_nickname.label}</div>
130 <div class="content">{$form.pcp_roll_nickname.html}
131 <div
132 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>
133 </div>
134 <div class="clear"></div>
135 </div>
136 <div id="personalNoteID" class="crm-public-form-item crm-section pcp_personal_note-section">
137 <div class="label">{$form.pcp_personal_note.label}</div>
138 <div class="content">
139 {$form.pcp_personal_note.html}
140 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
141 </div>
142 <div class="clear"></div>
143 </div>
144 </div>
145 </fieldset>
146 {/if}
147
148 {if $form.payment_processor.label}
149 <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;">
150 <legend>{ts}Payment Options{/ts}</legend>
151 <div class="crm-public-form-item crm-section payment_processor-section">
152 <div class="label">{$form.payment_processor.label}</div>
153 <div class="content">{$form.payment_processor.html}</div>
154 <div class="clear"></div>
155 </div>
156 </fieldset>
157 {/if}
158
159 <div id="billing-payment-block">
160 {* If we have a payment processor, load it - otherwise it happens via ajax *}
161 {if $paymentProcessorID or $isBillingAddressRequiredForPayLater}
162 {include file="CRM/Event/Form/Registration/Register.tpl" snippet=4}
163 {/if}
164 </div>
165 {include file="CRM/common/paymentBlock.tpl"}
166
167 <div class="crm-public-form-item crm-section custom_pre-section">
168 {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
169 </div>
170
171 {if $isCaptcha}
172 {include file='CRM/common/ReCAPTCHA.tpl'}
173 {/if}
174
175 <div id="crm-submit-buttons" class="crm-submit-buttons">
176 {include file="CRM/common/formButtons.tpl" location="bottom"}
177 </div>
178
179 {if $event.footer_text}
180 <div id="footer_text" class="crm-public-form-item crm-section event_footer_text-section">
181 <p>{$event.footer_text}</p>
182 </div>
183 {/if}
184 </div>
185 <script type="text/javascript">
186 {literal}
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();
192 }
193 else {
194 var processorTypeId = elementObj.filter(':checked').val();
195 }
196
197 if (payPalExpressId != 0 && payPalExpressId == processorTypeId) {
198 cj("#crm-submit-buttons").hide();
199 }
200 else {
201 cj("#crm-submit-buttons").show();
202 }
203 }
204
205 cj('input[name="payment_processor"]').change(function () {
206 toggleConfirmButton();
207 });
208
209 cj("#additional_participants").change(function () {
210 skipPaymentMethod();
211 });
212
213 CRM.$(function($) {
214 toggleConfirmButton();
215 skipPaymentMethod();
216 });
217
218 // Hides billing and payment options block - but only if a price set is used.
219 // Called from display() in Calculate.tpl, depends on display() having been called.
220 function skipPaymentMethod() {
221 // If we're in quick-config price set, we do not have the pricevalue hidden element, so just return.
222 if (cj('#pricevalue').length == 0) {
223 return;
224 }
225 // CRM-15433 Remove currency symbol, decimal separator so we can check for zero numeric total regardless of localization.
226 currentTotal = cj('#pricevalue').text().replace(/[^\/\d]/g,'');
227 var isMultiple = '{/literal}{$event.is_multiple_registrations}{literal}';
228
229 var flag = 1;
230 var payment_options = cj(".payment_options-group");
231 var payment_processor = cj("div.payment_processor-section");
232 var payment_information = cj("div#payment_information");
233
234 // Do not hide billing and payment blocks if user is registering additional participants, since we do not know total owing.
235 if (isMultiple && cj("#additional_participants").val() && currentTotal == 0) {
236 flag = 0;
237 }
238
239 if (currentTotal == 0 && flag) {
240 payment_options.hide();
241 payment_processor.hide();
242 payment_information.hide();
243 // also unset selected payment methods
244 cj('input[name="payment_processor"]').removeProp('checked');
245 }
246 else {
247 payment_options.show();
248 payment_processor.show();
249 payment_information.show();
250 }
251 }
252
253 {/literal}
254 </script>
255 {/if}
256 {literal}
257 <script type="text/javascript">
258 {/literal}{if $pcp && $is_honor_roll }pcpAnonymous();
259 {/if}{literal}
260
261 function allowParticipant() {
262 {/literal}{if $allowGroupOnWaitlist}{literal}
263 var additionalParticipants = cj('#additional_participants').val();
264 var pricesetParticipantCount = 0;
265 {/literal}{if $priceSet}{literal}
266 pricesetParticipantCount = pPartiCount;
267 {/literal}{/if}{literal}
268
269 allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount);
270 {/literal}{/if}{literal}
271 }
272
273 {/literal}{if ($bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
274 {literal}
275 showHidePayPalExpressOption();
276 {/literal}{/if}{literal}
277
278 function showHidePayPalExpressOption() {
279 if (( cj("#bypass_payment").val() == 1 )) {
280 cj("#crm-submit-buttons").show();
281 cj("#paypalExpress").hide();
282 }
283 else {
284 cj("#paypalExpress").show();
285 cj("#crm-submit-buttons").hide();
286 }
287 }
288
289 {/literal}{if ($bypassPayment and $showHidePaymentInformation)}{literal}
290 showHidePaymentInfo();
291 {/literal} {/if}{literal}
292
293 function showHidePaymentInfo() {
294 if (( cj("#bypass_payment").val() == 1 )) {
295 cj('#billing-payment-block').hide();
296 }
297 else {
298 cj('#billing-payment-block').show();
299 }
300 }
301
302 {/literal}{if $allowGroupOnWaitlist}{literal}
303 allowGroupOnWaitlist(0, 0);
304 {/literal}{/if}{literal}
305
306 function allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount) {
307 {/literal}{if $isAdditionalParticipants}{literal}
308 if (!additionalParticipants) {
309 additionalParticipants = cj('#additional_participants').val();
310 }
311 {/literal}{else}{literal}
312 additionalParticipants = 0;
313 {/literal}{/if}{literal}
314
315 additionalParticipants = parseInt(additionalParticipants);
316 if (!additionalParticipants) {
317 additionalParticipants = 0;
318 }
319
320 var availableRegistrations = {/literal}'{$availableRegistrations}'{literal};
321 var totalParticipants = parseInt(additionalParticipants) + 1;
322
323 if (pricesetParticipantCount) {
324 // add priceset count if any
325 totalParticipants += parseInt(pricesetParticipantCount) - 1;
326 }
327 var isrequireApproval = {/literal}'{$requireApprovalMsg}'{literal};
328
329 if (totalParticipants > availableRegistrations) {
330 cj("#id-waitlist-msg").show();
331 cj("#id-waitlist-approval-msg").show();
332
333 //set the value for hidden bypass payment.
334 cj("#bypass_payment").val(1);
335 }
336 else {
337 if (isrequireApproval) {
338 cj("#id-waitlist-approval-msg").show();
339 cj("#id-waitlist-msg").hide();
340 }
341 else {
342 cj("#id-waitlist-approval-msg").hide();
343 }
344 //reset value since user don't want or not eligible for waitlist
345 cj("#bypass_payment").val(0);
346 }
347
348 //now call showhide payment info.
349 {/literal}
350 {if ($bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}{literal}
351 showHidePayPalExpressOption();
352 {/literal}{/if}
353 {literal}
354
355 {/literal}{if ($bypassPayment) and $showHidePaymentInformation}{literal}
356 showHidePaymentInfo();
357 {/literal}{/if}{literal}
358 }
359
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 = '';
365 }
366 if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
367 cj('#nickID, #nameID, #personalNoteID').hide();
368 }
369 else {
370 if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
371 cj('#nameID, #nickID, #personalNoteID').show();
372 }
373 else {
374 cj('#nameID').show();
375 cj('#nickID, #personalNoteID').hide();
376 }
377 }
378 }
379 {/literal}{/if}{literal}
380
381 </script>
382 {/literal}