Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
2a73d3b0 | 5 | | Copyright CiviCRM LLC (c) 2004-2017 | |
6a488035 TO |
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 | *} | |
7bf9cde2 | 26 | {* Callback snippet: Load payment processor *} |
f9c24028 | 27 | {if $action & 1024} |
6a488035 | 28 | {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"} |
f9c24028 | 29 | {/if} |
6a488035 | 30 | |
f9c24028 | 31 | {include file="CRM/common/TrackingFields.tpl"} |
2d579f42 | 32 | |
f9c24028 | 33 | <div class="crm-event-id-{$event.id} crm-block crm-event-register-form-block"> |
6a488035 | 34 | |
f9c24028 | 35 | {* moved to tpl since need to show only for primary participant page *} |
36 | {if $requireApprovalMsg || $waitlistMsg} | |
37 | <div id="id-waitlist-approval-msg" class="messages status no-popup"> | |
38 | {if $requireApprovalMsg} | |
39 | <div id="id-req-approval-msg">{$requireApprovalMsg}</div> | |
40 | {/if} | |
6a488035 | 41 | {if $waitlistMsg} |
f9c24028 | 42 | <div id="id-waitlist-msg">{$waitlistMsg}</div> |
43 | {/if} | |
44 | </div> | |
45 | {/if} | |
6a488035 | 46 | |
f9c24028 | 47 | {if $contact_id} |
37326fa1 | 48 | <div class="messages status no-popup crm-not-you-message" id="crm-event-register-different"> |
f9c24028 | 49 | {ts 1=$display_name}Welcome %1{/ts}. (<a |
50 | href="{crmURL p='civicrm/event/register' q="cid=0&reset=1&id=`$event.id`"}" | |
51 | 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>?) | |
52 | </div> | |
53 | {/if} | |
54 | {if $event.intro_text} | |
d0f11dd0 | 55 | <div id="intro_text" class="crm-public-form-item crm-section intro_text-section"> |
6a488035 | 56 | <p>{$event.intro_text}</p> |
f9c24028 | 57 | </div> |
58 | {/if} | |
d44019b2 | 59 | |
f9c24028 | 60 | {include file="CRM/common/cidzero.tpl"} |
61 | {if $pcpSupporterText} | |
d0f11dd0 | 62 | <div class="crm-public-form-item crm-section pcpSupporterText-section"> |
6a488035 | 63 | <div class="content">{$pcpSupporterText}</div> |
f9c24028 | 64 | </div> |
65 | {/if} | |
6a488035 | 66 | |
f9c24028 | 67 | {if $form.additional_participants.html} |
d0f11dd0 | 68 | <div class="crm-public-form-item crm-section additional_participants-section" id="noOfparticipants"> |
293430cc | 69 | <div class="label">{$form.additional_participants.label} <span class="crm-marker" title="{ts}This field is required.{/ts}">*</span></div> |
6a488035 | 70 | <div class="content"> |
e7eb9ae3 | 71 | {$form.additional_participants.html}{if $contact_id || $contact_id == NULL}{ts}(including yourself){/ts}{/if} |
f9c24028 | 72 | <br/> |
73 | <span | |
74 | 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> | |
6a488035 TO |
75 | </div> |
76 | <div class="clear"></div> | |
f9c24028 | 77 | </div> |
78 | {/if} | |
6a488035 | 79 | |
d0f11dd0 GC |
80 | <div class="crm-public-form-item crm-section cms_user-section"> |
81 | {* User account registration option. Displays if enabled for one of the profiles on this page. *} | |
82 | {include file="CRM/common/CMSUser.tpl"} | |
83 | </div> | |
e2f50aed | 84 | |
d0f11dd0 GC |
85 | <div class="crm-public-form-item crm-section custom_pre-section"> |
86 | {* Display "Top of page" profile immediately after the introductory text *} | |
87 | {include file="CRM/UF/Form/Block.tpl" fields=$customPre} | |
88 | </div> | |
e2f50aed | 89 | |
f9c24028 | 90 | {if $priceSet} |
d0f11dd0 | 91 | {if ! $quickConfig}<fieldset id="priceset" class="crm-public-form-item crm-group priceset-group"> |
f9c24028 | 92 | <legend>{$event.fee_label}</legend>{/if} |
93 | {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"} | |
94 | {include file="CRM/Price/Form/ParticipantCount.tpl"} | |
95 | {if ! $quickConfig}</fieldset>{/if} | |
6a488035 | 96 | {/if} |
f9c24028 | 97 | {if $pcp && $is_honor_roll } |
d0f11dd0 GC |
98 | <fieldset class="crm-public-form-item crm-group pcp-group"> |
99 | <div class="crm-public-form-item crm-section pcp-section"> | |
100 | <div class="crm-public-form-item crm-section display_in_roll-section"> | |
f9c24028 | 101 | <div class="content"> |
102 | {$form.pcp_display_in_roll.html} | |
103 | {$form.pcp_display_in_roll.label} | |
6a488035 | 104 | </div> |
f9c24028 | 105 | <div class="clear"></div> |
106 | </div> | |
d0f11dd0 | 107 | <div id="nameID" class="crm-public-form-item crm-section is_anonymous-section"> |
f9c24028 | 108 | <div class="content"> |
109 | {$form.pcp_is_anonymous.html} | |
6a488035 | 110 | </div> |
f9c24028 | 111 | <div class="clear"></div> |
112 | </div> | |
d0f11dd0 | 113 | <div id="nickID" class="crm-public-form-item crm-section pcp_roll_nickname-section"> |
f9c24028 | 114 | <div class="label">{$form.pcp_roll_nickname.label}</div> |
115 | <div class="content">{$form.pcp_roll_nickname.html} | |
116 | <div | |
117 | 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> | |
6a488035 | 118 | </div> |
f9c24028 | 119 | <div class="clear"></div> |
120 | </div> | |
d0f11dd0 | 121 | <div id="personalNoteID" class="crm-public-form-item crm-section pcp_personal_note-section"> |
f9c24028 | 122 | <div class="label">{$form.pcp_personal_note.label}</div> |
123 | <div class="content"> | |
124 | {$form.pcp_personal_note.html} | |
125 | <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div> | |
6a488035 | 126 | </div> |
f9c24028 | 127 | <div class="clear"></div> |
128 | </div> | |
6a488035 | 129 | </div> |
f9c24028 | 130 | </fieldset> |
131 | {/if} | |
6a488035 | 132 | |
e02d7e96 | 133 | {if $form.payment_processor_id.label} |
d0f11dd0 | 134 | <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;"> |
f9c24028 | 135 | <legend>{ts}Payment Options{/ts}</legend> |
136 | <div class="crm-section payment_processor-section"> | |
e02d7e96 EM |
137 | <div class="label">{$form.payment_processor_id.label}</div> |
138 | <div class="content">{$form.payment_processor_id.html}</div> | |
f9c24028 | 139 | <div class="clear"></div> |
140 | </div> | |
141 | </fieldset> | |
142 | {/if} | |
6a488035 | 143 | |
7245c66f BS |
144 | {if $priceSet} |
145 | {include file='CRM/Core/BillingBlockWrapper.tpl'} | |
146 | {/if} | |
6a488035 | 147 | |
d0f11dd0 GC |
148 | <div class="crm-public-form-item crm-section custom_pre-section"> |
149 | {include file="CRM/UF/Form/Block.tpl" fields=$customPost} | |
150 | </div> | |
6a488035 | 151 | |
f9c24028 | 152 | {if $isCaptcha} |
153 | {include file='CRM/common/ReCAPTCHA.tpl'} | |
154 | {/if} | |
6a488035 | 155 | |
f9c24028 | 156 | <div id="crm-submit-buttons" class="crm-submit-buttons"> |
157 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
158 | </div> | |
6a488035 | 159 | |
f9c24028 | 160 | {if $event.footer_text} |
d0f11dd0 | 161 | <div id="footer_text" class="crm-public-form-item crm-section event_footer_text-section"> |
6a488035 | 162 | <p>{$event.footer_text}</p> |
f9c24028 | 163 | </div> |
164 | {/if} | |
165 | </div> | |
166 | <script type="text/javascript"> | |
167 | {literal} | |
f9c24028 | 168 | |
461803d0 DG |
169 | cj("#additional_participants").change(function () { |
170 | skipPaymentMethod(); | |
171 | }); | |
172 | ||
5ec4b965 | 173 | {/literal} |
174 | {if $pcp && $is_honor_roll } | |
175 | pcpAnonymous(); | |
176 | {/if} | |
177 | {literal} | |
6a488035 | 178 | |
f9c24028 | 179 | function allowParticipant() { |
180 | {/literal}{if $allowGroupOnWaitlist}{literal} | |
181 | var additionalParticipants = cj('#additional_participants').val(); | |
182 | var pricesetParticipantCount = 0; | |
183 | {/literal}{if $priceSet}{literal} | |
184 | pricesetParticipantCount = pPartiCount; | |
6a488035 TO |
185 | {/literal}{/if}{literal} |
186 | ||
f9c24028 | 187 | allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount); |
188 | {/literal}{/if}{literal} | |
6a488035 | 189 | } |
f9c24028 | 190 | |
f9c24028 | 191 | {/literal}{if $allowGroupOnWaitlist}{literal} |
192 | allowGroupOnWaitlist(0, 0); | |
193 | {/literal}{/if}{literal} | |
194 | ||
195 | function allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount) { | |
196 | {/literal}{if $isAdditionalParticipants}{literal} | |
197 | if (!additionalParticipants) { | |
198 | additionalParticipants = cj('#additional_participants').val(); | |
199 | } | |
200 | {/literal}{else}{literal} | |
201 | additionalParticipants = 0; | |
6a488035 TO |
202 | {/literal}{/if}{literal} |
203 | ||
f9c24028 | 204 | additionalParticipants = parseInt(additionalParticipants); |
205 | if (!additionalParticipants) { | |
206 | additionalParticipants = 0; | |
207 | } | |
6a488035 | 208 | |
f9c24028 | 209 | var availableRegistrations = {/literal}'{$availableRegistrations}'{literal}; |
210 | var totalParticipants = parseInt(additionalParticipants) + 1; | |
6a488035 | 211 | |
f9c24028 | 212 | if (pricesetParticipantCount) { |
213 | // add priceset count if any | |
214 | totalParticipants += parseInt(pricesetParticipantCount) - 1; | |
215 | } | |
216 | var isrequireApproval = {/literal}'{$requireApprovalMsg}'{literal}; | |
6a488035 | 217 | |
f9c24028 | 218 | if (totalParticipants > availableRegistrations) { |
219 | cj("#id-waitlist-msg").show(); | |
220 | cj("#id-waitlist-approval-msg").show(); | |
6a488035 | 221 | |
f9c24028 | 222 | //set the value for hidden bypass payment. |
223 | cj("#bypass_payment").val(1); | |
6a488035 | 224 | } |
f9c24028 | 225 | else { |
226 | if (isrequireApproval) { | |
227 | cj("#id-waitlist-approval-msg").show(); | |
228 | cj("#id-waitlist-msg").hide(); | |
5ec4b965 | 229 | cj("#bypass_payment").val(1); |
f9c24028 | 230 | } |
231 | else { | |
232 | cj("#id-waitlist-approval-msg").hide(); | |
5ec4b965 | 233 | cj("#bypass_payment").val(0); |
f9c24028 | 234 | } |
235 | //reset value since user don't want or not eligible for waitlist | |
5ec4b965 | 236 | skipPaymentMethod(); |
6a488035 | 237 | } |
f9c24028 | 238 | } |
239 | ||
2c5311b9 EM |
240 | {/literal} |
241 | {if $pcp && $is_honor_roll }{literal} | |
f9c24028 | 242 | function pcpAnonymous() { |
243 | // clear nickname field if anonymous is true | |
244 | if (document.getElementsByName("pcp_is_anonymous")[1].checked) { | |
245 | document.getElementById('pcp_roll_nickname').value = ''; | |
246 | } | |
247 | if (!document.getElementsByName("pcp_display_in_roll")[0].checked) { | |
248 | cj('#nickID, #nameID, #personalNoteID').hide(); | |
249 | } | |
250 | else { | |
251 | if (document.getElementsByName("pcp_is_anonymous")[0].checked) { | |
252 | cj('#nameID, #nickID, #personalNoteID').show(); | |
253 | } | |
254 | else { | |
255 | cj('#nameID').show(); | |
256 | cj('#nickID, #personalNoteID').hide(); | |
257 | } | |
258 | } | |
259 | } | |
2c5311b9 EM |
260 | {/literal} |
261 | {/if} | |
262 | {literal} | |
6a488035 TO |
263 | |
264 | </script> | |
265 | {/literal} |