Merge branch 'CRM-12019-b' of github.com:colemanw/civicrm-core into colemanw-CRM...
[civicrm-core.git] / templates / CRM / Event / Form / Registration / Register.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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{if $ppType}
27 {include file="CRM/Core/BillingBlock.tpl" context="front-end"}
28
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"><legend>{ts}Checkout with PayPal{/ts}</legend>
34 <div class="description">{ts}Click the PayPal button to continue.{/ts}</div>
35 <div>{$form.$expressButtonName.html} <span style="font-size:11px; font-family: Arial, Verdana;">Checkout securely. Pay without sharing your financial information. </span>
36 </div>
37 </fieldset>
38{/if}
39</div>
40{else}
41{if $action & 1024}
42 {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"}
43{/if}
44
45{include file="CRM/common/TrackingFields.tpl"}
46
47{capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture}
48<div class="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" id="crm-event-register-different">
64 {ts 1=$display_name}Welcome %1{/ts}. (<a href="{crmURL p='civicrm/event/register' q="cid=0&reset=1&id=`$event.id`"}" 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>?)</div>
65{/if}
66{if $event.intro_text}
67 <div id="intro_text" class="crm-section intro_text-section">
68 <p>{$event.intro_text}</p>
69 </div>
70{/if}
71
72{if $pcpSupporterText}
73 <div class="crm-section pcpSupporterText-section">
74 <div class="content">{$pcpSupporterText}</div>
75 </div>
76{/if}
77
78{if $form.additional_participants.html}
79 <div class="crm-section additional_participants-section" id="noOfparticipants">
80 <div class="label">{$form.additional_participants.label}</div>
81 <div class="content">
82 {$form.additional_participants.html}{if $contact_id || $contact_id == NULL} &nbsp; ({ts}including yourself{/ts}){/if}<br />
83 <span 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>
84 </div>
85 <div class="clear"></div>
86 </div>
87{/if}
88
89{if $priceSet}
90 {if ! $quickConfig}<fieldset id="priceset" class="crm-group priceset-group"><legend>{$event.fee_label}</legend>{/if}
91 {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}
92 {include file="CRM/Price/Form/ParticipantCount.tpl"}
93 {if ! $quickConfig}</fieldset>{/if}
94
95 {if $form.is_pay_later}
96 <div class="crm-section pay_later-section">
97 <div class="label">&nbsp;</div>
98 <div class="content">{$form.is_pay_later.html}&nbsp;{$form.is_pay_later.label}</div>
99 <div class="clear"></div>
100 </div>
101 {/if}
102{/if}
103{if $initialPayment}
104 {include file="CRM/Price/Form/InitialPayment.tpl" extends="Contribution" paymentMode='online'}
105{/if}
106{if $pcp && $is_honor_roll }
107 <fieldset class="crm-group pcp-group">
108 <div class="crm-section pcp-section">
109 <div class="crm-section display_in_roll-section">
110 <div class="content">
111 {$form.pcp_display_in_roll.html} &nbsp;
112 {$form.pcp_display_in_roll.label}
113 </div>
114 <div class="clear"></div>
115 </div>
116 <div id="nameID" class="crm-section is_anonymous-section">
117 <div class="content">
118 {$form.pcp_is_anonymous.html}
119 </div>
120 <div class="clear"></div>
121 </div>
122 <div id="nickID" class="crm-section pcp_roll_nickname-section">
123 <div class="label">{$form.pcp_roll_nickname.label}</div>
124 <div class="content">{$form.pcp_roll_nickname.html}
125 <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>
126 </div>
127 <div class="clear"></div>
128 </div>
129 <div id="personalNoteID" class="crm-section pcp_personal_note-section">
130 <div class="label">{$form.pcp_personal_note.label}</div>
131 <div class="content">
132 {$form.pcp_personal_note.html}
133 <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
134 </div>
135 <div class="clear"></div>
136 </div>
137 </div>
138 </fieldset>
139{/if}
140
141{* User account registration option. Displays if enabled for one of the profiles on this page. *}
142{include file="CRM/common/CMSUser.tpl"}
143
144{include file="CRM/UF/Form/Block.tpl" fields=$customPre}
145
146{if $form.payment_processor.label}
147<fieldset class="crm-group payment_options-group">
148 <legend>{ts}Payment Options{/ts}</legend>
149 <div class="crm-section payment_processor-section">
150 <div class="label">{$form.payment_processor.label}</div>
151 <div class="content">{$form.payment_processor.html}</div>
152 <div class="clear"></div>
153 </div>
154</fieldset>
155{/if}
156
157<div id="billing-payment-block"></div>
158{include file="CRM/common/paymentBlock.tpl"}
159
160{include file="CRM/UF/Form/Block.tpl" fields=$customPost}
161
162{if $isCaptcha}
163 {include file='CRM/common/ReCAPTCHA.tpl'}
164{/if}
165
166<div id="crm-submit-buttons" class="crm-submit-buttons">
167 {include file="CRM/common/formButtons.tpl" location="bottom"}
168</div>
169
170{if $event.footer_text}
171 <div id="footer_text" class="crm-section event_footer_text-section">
172 <p>{$event.footer_text}</p>
173 </div>
174{/if}
175</div>
176
177<script type="text/javascript">
178{literal}
179function toggleConfirmButton() {
180 var payPalExpressId = {/literal}{$payPalExpressId}{literal};
181 var elementObj = cj('input[name="payment_processor"]');
182 if ( elementObj.attr('type') == 'hidden' ) {
183 var processorTypeId = elementObj.val( );
184 } else {
185 var processorTypeId = elementObj.filter(':checked').val();
186 }
187
188 if (payPalExpressId !=0 && payPalExpressId == processorTypeId) {
189 cj("#crm-submit-buttons").hide();
190 } else {
191 cj("#crm-submit-buttons").show();
192 }
193}
194
195cj('input[name="payment_processor"]').change( function() {
196 toggleConfirmButton();
197});
198
199cj(function() {
200 toggleConfirmButton();
201});
202{/literal}
203</script>
204{/if}
205{literal}
206<script type="text/javascript">
207 {/literal}{if $pcp && $is_honor_roll }pcpAnonymous();{/if}{literal}
208
209 function allowParticipant( ) {
210 {/literal}{if $allowGroupOnWaitlist}{literal}
211 var additionalParticipants = cj('#additional_participants').val();
212 var pricesetParticipantCount = 0;
213 {/literal}{if $priceSet}{literal}
214 pricesetParticipantCount = pPartiCount;
215 {/literal}{/if}{literal}
216
217 allowGroupOnWaitlist( additionalParticipants, pricesetParticipantCount );
218 {/literal}{/if}{literal}
219 }
220
221 {/literal}{if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
222 {literal}
223 showHidePayPalExpressOption( );
224 {/literal}{/if}{literal}
225
226 function showHidePayPalExpressOption( )
227 {
228 var payLaterElement = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal};
229 if ( ( cj("#bypass_payment").val( ) == 1 ) ||
230 ( payLaterElement && document.getElementsByName('is_pay_later')[0].checked ) ) {
231 cj("#crm-submit-buttons").show();
232 cj("#paypalExpress").hide();
233 } else {
234 cj("#paypalExpress").show();
235 cj("#crm-submit-buttons").hide();
236 }
237 }
238
239 {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal}
240 showHidePaymentInfo( );
241 {/literal} {/if}{literal}
242
243 function showHidePaymentInfo( )
244 {
245 var payLater = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal};
246
247 if ( ( cj("#bypass_payment").val( ) == 1 ) ||
248 ( payLater && document.getElementsByName('is_pay_later')[0].checked ) ) {
249 cj('#billing-payment-block').hide();
250 } else {
251 cj('#billing-payment-block').show();
252 }
253 }
254
255 {/literal}{if $allowGroupOnWaitlist}{literal}
256 allowGroupOnWaitlist( 0, 0 );
257 {/literal}{/if}{literal}
258
259 function allowGroupOnWaitlist( additionalParticipants, pricesetParticipantCount )
260 {
261 {/literal}{if $isAdditionalParticipants}{literal}
262 if ( !additionalParticipants ) {
263 additionalParticipants = cj('#additional_participants').val();
264 }
265 {/literal}{else}{literal}
266 additionalParticipants = 0;
267 {/literal}{/if}{literal}
268
269 additionalParticipants = parseInt( additionalParticipants );
270 if ( ! additionalParticipants ) {
271 additionalParticipants = 0;
272 }
273
274 var availableRegistrations = {/literal}'{$availableRegistrations}'{literal};
275 var totalParticipants = parseInt( additionalParticipants ) + 1;
276
277 if ( pricesetParticipantCount ) {
278 // add priceset count if any
279 totalParticipants += parseInt(pricesetParticipantCount) - 1;
280 }
281 var isrequireApproval = {/literal}'{$requireApprovalMsg}'{literal};
282
283 if ( totalParticipants > availableRegistrations ) {
284 cj( "#id-waitlist-msg" ).show( );
285 cj( "#id-waitlist-approval-msg" ).show( );
286
287 //set the value for hidden bypass payment.
288 cj( "#bypass_payment").val( 1 );
289
290 //hide pay later.
291 {/literal}{if $form.is_pay_later}{literal}
292 cj("#is-pay-later").hide( );
293 {/literal} {/if}{literal}
294
295 } else {
296 if ( isrequireApproval ) {
297 cj( "#id-waitlist-approval-msg" ).show( );
298 cj( "#id-waitlist-msg" ).hide( );
299 } else {
300 cj( "#id-waitlist-approval-msg" ).hide( );
301 }
302 //reset value since user don't want or not eligible for waitlist
303 cj( "#bypass_payment").val( 0 );
304
305 //need to show paylater if exists.
306 {/literal}{if $form.is_pay_later}{literal}
307 cj("#is-pay-later").show( );
308 {/literal} {/if}{literal}
309 }
310
311 //now call showhide payment info.
312 {/literal}
313 {if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}{literal}
314 showHidePayPalExpressOption( );
315 {/literal}{/if}
316 {literal}
317
318 {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal}
319 showHidePaymentInfo( );
320 {/literal}{/if}{literal}
321 }
322
323 {/literal}{if $pcp && $is_honor_roll }{literal}
324 function pcpAnonymous( ) {
325 // clear nickname field if anonymous is true
326 if ( document.getElementsByName("pcp_is_anonymous")[1].checked ) {
327 document.getElementById('pcp_roll_nickname').value = '';
328 }
329 if ( ! document.getElementsByName("pcp_display_in_roll")[0].checked ) {
330 cj('#nickID, #nameID, #personalNoteID').hide();
331 } else {
332 if ( document.getElementsByName("pcp_is_anonymous")[0].checked ) {
333 cj('#nameID, #nickID, #personalNoteID').show();
334 } else {
335 cj('#nameID').show();
336 cj('#nickID, #personalNoteID').hide();
337 }
338 }
339 }
340 {/literal}{/if}{literal}
341
342</script>
343{/literal}