Merge pull request #3119 from pradpnayak/CRM-14380
[civicrm-core.git] / templates / CRM / Event / Form / ManageEvent / Registration.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 $addProfileBottomAdd OR $addProfileBottom}
27 <td scope="row" class="label"
28 width="20%">{if $addProfileBottomAdd }{$form.additional_custom_post_id_multiple[$profileBottomNumAdd].label}
29 {else}{$form.custom_post_id[$profileBottomNum].label}{/if}</td>
30 <td>{if $addProfileBottomAdd }{$form.additional_custom_post_id_multiple[$profileBottomNumAdd].html}{else}{$form.custom_post_id_multiple[$profileBottomNum].html}{/if}
31 &nbsp;<span class='profile_bottom_link_remove'><a href="#" class="crm-hover-button crm-button-rem-profile"
32 data-addtlPartc="{$addProfileBottomAdd}"><span
33 class="icon ui-icon-trash"></span>{ts}remove profile{/ts}</a></span>&nbsp;&nbsp;<span
34 class='profile_bottom_link'>&nbsp;<a href="#" class="crm-hover-button crm-button-add-profile"><span
35 class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
36 <br/>
37 {if $addProfileBottomAdd }
38 <span
39 class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
40 {else}
41 <span
42 class="description">{ts}Include additional fields on this registration form by configuring and selecting a CiviCRM Profile to be included at the bottom of the page.{/ts}</span>
43 {/if}
44 <br/><span class="profile-links"></span>
45 </td>
46 {else}
47 {assign var=eventID value=$id}
48 <div id="help">
49 {ts}If you want to provide an Online Registration page for this event, check the first box below and then complete the fields on this form.{/ts}
50 {help id="id-event-reg"}
51 </div>
52 <div class="crm-block crm-form-block crm-event-manage-registration-form-block">
53 <div class="crm-submit-buttons">
54 {include file="CRM/common/formButtons.tpl" location="top"}
55 </div>
56
57 <div id="register">
58 <table class="form-layout">
59 <tr class="crm-event-manage-registration-form-block-is_online_registration">
60 <td class="label">{$form.is_online_registration.label}</td>
61 <td>{$form.is_online_registration.html}
62 <span class="description">{ts}Online registration enabled?{/ts}</span>
63 </td>
64 </tr>
65 </table>
66 </div>
67 <div class="spacer"></div>
68 <div id="registration_blocks">
69 <table class="form-layout-compressed">
70
71 <tr class="crm-event-manage-registration-form-block-registration_link_text">
72 <td scope="row" class="label"
73 width="20%">{$form.registration_link_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='registration_link_text' id=$eventID}{/if}</td>
74 <td>{$form.registration_link_text.html} {help id="id-link_text"}</td>
75 </tr>
76 {if !$isTemplate}
77 <tr class="crm-event-manage-registration-form-block-registration_start_date">
78 <td scope="row" class="label" width="20%">{$form.registration_start_date.label}</td>
79 <td>{include file="CRM/common/jcalendar.tpl" elementName=registration_start_date}</td>
80 </tr>
81 <tr class="crm-event-manage-registration-form-block-registration_end_date">
82 <td scope="row" class="label" width="20%">{$form.registration_end_date.label}</td>
83 <td>{include file="CRM/common/jcalendar.tpl" elementName=registration_end_date}</td>
84 </tr>
85 {/if}
86 <tr class="crm-event-manage-registration-form-block-is_multiple_registrations">
87 <td scope="row" class="label" width="20%">{$form.is_multiple_registrations.label}</td>
88 <td>{$form.is_multiple_registrations.html} {help id="id-allow_multiple"}</td>
89 </tr>
90 <tr class="crm-event-manage-registration-form-block-allow_same_participant_emails">
91 <td scope="row" class="label" width="20%">{$form.allow_same_participant_emails.label}</td>
92 <td>{$form.allow_same_participant_emails.html} {help id="id-allow_same_email"}</td>
93 </tr>
94 <tr class="crm-event-manage-registration-form-block-dedupe_rule_group_id">
95 <td scope="row" class="label" width="20%">{$form.dedupe_rule_group_id.label}</td>
96 <td>{$form.dedupe_rule_group_id.html} {help id="id-dedupe_rule_group_id"}</td>
97 </tr>
98 <tr class="crm-event-manage-registration-form-block-requires_approval">
99 {if $form.requires_approval}
100 <td scope="row" class="label" width="20%">{$form.requires_approval.label}</td>
101 <td>{$form.requires_approval.html} {help id="id-requires_approval"}</td>
102 {/if}
103 </tr>
104 <tr id="id-approval-text" class="crm-event-manage-registration-form-block-approval_req_text">
105 {if $form.approval_req_text}
106 <td scope="row" class="label"
107 width="20%">{$form.approval_req_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='approval_req_text' id=$eventID}{/if}</td>
108 <td>{$form.approval_req_text.html}</td>
109 {/if}
110 </tr>
111 <tr class="crm-event-manage-registration-form-block-expiration_time">
112 <td scope="row" class="label" width="20%">{$form.expiration_time.label}</td>
113 <td>{$form.expiration_time.html|crmAddClass:four} {help id="id-expiration_time"}</td>
114 </tr>
115 </table>
116 <div class="spacer"></div>
117
118 {*Registration Block*}
119 <fieldset id="registration" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
120 <legend class="collapsible-title">{ts}Registration Screen{/ts}</legend>
121 <div id="registration_screen">
122 <table class="form-layout-compressed">
123 <tr class="crm-event-manage-registration-form-block-intro_text">
124 <td scope="row" class="label"
125 width="20%">{$form.intro_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='intro_text' id=$eventID}{/if}</td>
126 <td>{$form.intro_text.html}
127 <div
128 class="description">{ts}Introductory message / instructions for online event registration page (may include HTML formatting tags).{/ts}</div>
129 </td>
130 </tr>
131 <tr class="crm-event-manage-registration-form-block-footer_text">
132 <td scope="row" class="label"
133 width="20%">{$form.footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='footer_text' id=$eventID}{/if}</td>
134 <td>{$form.footer_text.html}
135 <div class="description">{ts}Optional footer text for registration screen.{/ts}</div>
136 </td>
137 </tr>
138 </table>
139 <table class="form-layout-compressed">
140 <tr class="crm-event-manage-registration-form-block-custom_pre_id">
141 <td scope="row" class="label" width="20%">{$form.custom_pre_id.label}</td>
142 <td>{$form.custom_pre_id.html}<br/>
143 <span
144 class="description">{ts}Include additional fields on this registration form by configuring and selecting a CiviCRM Profile to be included at the top of the page (immediately after the introductory message).{/ts}{help id="event-profile"}</span><br/>
145 </td>
146 </tr>
147 <tr id="profile_post" class="crm-event-manage-registration-form-block-custom_post_id">
148 <td scope="row" class="label" width="20%">{$form.custom_post_id.label}</td>
149 <td>{$form.custom_post_id.html}
150 &nbsp;<span class='profile_bottom_link_main {if $profilePostMultiple}hiddenElement{/if}'>&nbsp;<a href="#"
151 class="crm-hover-button crm-button-add-profile"><span
152 class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
153 <br/>
154 <span
155 class="description">{ts}Include additional fields on this registration form by configuring and selecting a CiviCRM Profile to be included at the bottom of the page.{/ts}</span>
156 </td>
157 </tr>
158
159 {if $profilePostMultiple}
160 {foreach from=$profilePostMultiple item=profilePostId key=profilePostNum name=profilePostIdName}
161 <tr id="custom_post_id_multiple_{$profilePostNum}_wrapper"
162 class='crm-event-manage-registration-form-block-custom_post_multiple'>
163 <td scope="row" class="label" width="20%">{$form.custom_post_id_multiple.$profilePostNum.label}</td>
164 <td>{$form.custom_post_id_multiple.$profilePostNum.html}
165 &nbsp;<span class='profile_bottom_link_remove'><a href="#"
166 class="crm-hover-button crm-button-rem-profile"><span
167 class="icon ui-icon-trash"></span>{ts}remove profile{/ts}</a></span>
168 {if $smarty.foreach.profilePostIdName.last}
169 &nbsp;&nbsp;
170 <span class='profile_bottom_link'><a href="#" class="crm-hover-button crm-button-add-profile"><span
171 class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
172 {/if}
173 <br/><span class="profile-links"></span>
174 </td>
175 </tr>
176 {/foreach}
177 {/if}
178 </table>
179 <table class="form-layout-compressed">
180 <tr id="additional_profile_pre" class="crm-event-manage-registration-form-block-additional_custom_pre_id">
181 <td scope="row" class="label" width="20%">{$form.additional_custom_pre_id.label}</td>
182 <td>{$form.additional_custom_pre_id.html}<br/>
183 <span
184 class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
185 <br/><span class="profile-links"></span>
186 </td>
187 </tr>
188 <tr id="additional_profile_post" class="crm-event-manage-registration-form-block-additional_custom_post_id">
189 <td scope="row" class="label" width="20%">{$form.additional_custom_post_id.label}</td>
190 <td>{$form.additional_custom_post_id.html}
191 &nbsp;<span class='profile_bottom_add_link_main {if $profilePostMultipleAdd}hiddenElement{/if}'><a
192 href="#" class="crm-hover-button crm-button-add-profile"><span
193 class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
194 <br/>
195 <span
196 class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
197 <br/><span class="profile-links"></span>
198 </td>
199 </tr>
200 {if $profilePostMultipleAdd}
201 {foreach from=$profilePostMultipleAdd item=profilePostIdA key=profilePostNumA name=profilePostIdAName}
202 <tr id='additional_custom_post_id_multiple_{$profilePostNumA}_wrapper'
203 class='crm-event-manage-registration-form-block-additional_custom_post_multiple'>
204 <td scope="row" class="label"
205 width="20%">{$form.additional_custom_post_id_multiple.$profilePostNumA.label}</td>
206 <td>{$form.additional_custom_post_id_multiple.$profilePostNumA.html}
207 &nbsp;<span class='profile_bottom_add_link_remove'><a href="#"
208 class="crm-hover-button crm-button-rem-profile"><span
209 class="icon ui-icon-trash"></span>{ts}remove profile{/ts}</a></span>
210 {if $smarty.foreach.profilePostIdAName.last}
211 &nbsp;&nbsp;
212 <span class='profile_bottom_add_link'><a href="#"
213 class="crm-hover-button crm-button-add-profile"><span
214 class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
215 {/if}
216 <br/><span class="profile-links"></span>
217 </td>
218 </tr>
219 {/foreach}
220 {/if}
221 </table>
222 </div>
223 </fieldset>
224
225 {*Confirmation Block*}
226 <fieldset id="confirm" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
227 <legend class="collapsible-title">{ts}Confirmation Screen{/ts}</legend>
228 {if !$is_monetary}
229 <table class="form-layout-compressed">
230 <tr class="crm-event-manage-registration-form-block-is_confirm_enabled">
231 <td scope="row" class="label" width="20%">{$form.is_confirm_enabled.label}</td>
232 <td>{$form.is_confirm_enabled.html}
233 <div class="description">{ts}Optionally hide the confirmation screen for free events.{/ts}</div>
234 </td>
235 </tr>
236 </table>
237 {/if}
238
239 <div id="confirm_screen_settings">
240 <table class="form-layout-compressed">
241 <tr class="crm-event-manage-registration-form-block-confirm_title">
242 <td scope="row" class="label" width="20%">{$form.confirm_title.label} <span
243 class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_title' id=$eventID}{/if}
244 </td>
245 <td>{$form.confirm_title.html}<br/>
246 <span
247 class="description">{ts}Page title for screen where user reviews and confirms their registration information.{/ts}</span>
248 </td>
249 </tr>
250 <tr class="crm-event-manage-registration-form-block-confirm_text">
251 <td scope="row" class="label"
252 width="20%">{$form.confirm_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_text' id=$eventID}{/if}</td>
253 <td>{$form.confirm_text.html}
254 <div class="description">{ts}Optional instructions / message for Confirmation screen.{/ts}</div>
255 </td>
256 </tr>
257 <tr class="crm-event-manage-registration-form-block-confirm_footer_text">
258 <td scope="row" class="label"
259 width="20%">{$form.confirm_footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_footer_text' id=$eventID}{/if}</td>
260 <td>{$form.confirm_footer_text.html}
261 <div class="description">{ts}Optional page footer text for Confirmation screen.{/ts}</div>
262 </td>
263 </tr>
264 </table>
265 </div>
266 </fieldset>
267
268 {*ThankYou Block*}
269 <fieldset id="thankyou" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
270 <legend class="collapsible-title">{ts}Thank-you Screen{/ts}</legend>
271 <table class="form-layout-compressed">
272 <tr class="crm-event-manage-registration-form-block-confirm_thankyou_title">
273 <td scope="row" class="label" width="20%">{$form.thankyou_title.label} <span
274 class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_title' id=$eventID}{/if}
275 </td>
276 <td>{$form.thankyou_title.html}
277 <div class="description">{ts}Page title for registration Thank-you screen.{/ts}</div>
278 </td>
279 </tr>
280 <tr class="crm-event-manage-registration-form-block-confirm_thankyou_text">
281 <td scope="row" class="label"
282 width="20%">{$form.thankyou_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_text' id=$eventID}{/if}</td>
283 <td>{$form.thankyou_text.html}
284 <div
285 class="description">{ts}Optional message for Thank-you screen (may include HTML formatting).{/ts}</div>
286 </td>
287 </tr>
288 <tr class="crm-event-manage-registration-form-block-confirm_thankyou_footer_text">
289 <td scope="row" class="label"
290 width="20%">{$form.thankyou_footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_footer_text' id=$eventID}{/if}</td>
291 <td>{$form.thankyou_footer_text.html}
292 <div
293 class="description">{ts}Optional footer text for Thank-you screen (often used to include links to other pages/activities on your site).{/ts}</div>
294 </td>
295 </tr>
296 </table>
297 </fieldset>
298
299 {* Confirmation Email Block *}
300 <fieldset id="mail" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
301 <legend class="collapsible-title">{ts}Confirmation Email{/ts}</legend>
302 <div>
303 <table class="form-layout-compressed">
304 <tr class="crm-event-manage-registration-form-block-is_email_confirm">
305 <td scope="row" class="label" width="20%">{$form.is_email_confirm.label}</td>
306 <td>{$form.is_email_confirm.html}<br/>
307 <span
308 class="description">{ts}Do you want a registration confirmation email sent automatically to the user? This email includes event date(s), location and contact information. For paid events, this email is also a receipt for their payment.{/ts}</span>
309 </td>
310 </tr>
311 </table>
312 <div id="confirmEmail">
313 <table class="form-layout-compressed">
314 <tr class="crm-event-manage-registration-form-block-confirm_email_text">
315 <td scope="row" class="label"
316 width="20%">{$form.confirm_email_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_email_text' id=$eventID}{/if}</td>
317 <td>{$form.confirm_email_text.html}<br/>
318 <span
319 class="description">{ts}Additional message or instructions to include in confirmation email.{/ts}</span>
320 </td>
321 </tr>
322 <tr class="crm-event-manage-registration-form-block-confirm_from_name">
323 <td scope="row" class="label" width="20%">{$form.confirm_from_name.label} <span
324 class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_from_name' id=$eventID}{/if}
325 </td>
326 <td>{$form.confirm_from_name.html}<br/>
327 <span class="description">{ts}FROM name for email.{/ts}</span>
328 </td>
329 </tr>
330 <tr class="crm-event-manage-registration-form-block-confirm_from_email">
331 <td scope="row" class="label" width="20%">{$form.confirm_from_email.label} <span class="marker">*</span></td>
332 <td>{$form.confirm_from_email.html}<br/>
333 <span
334 class="description">{ts}FROM email address (this must be a valid email account with your SMTP email service provider).{/ts}</span>
335 </td>
336 </tr>
337 <tr class="crm-event-manage-registration-form-block-cc_confirm">
338 <td scope="row" class="label" width="20%">{$form.cc_confirm.label}</td>
339 <td>{$form.cc_confirm.html}<br/>
340 <span
341 class="description">{ts}You can notify event organizers of each online registration by specifying one or more email addresses to receive a carbon copy (cc). Multiple email addresses should be separated by a comma (e.g. jane@example.org, paula@example.org).{/ts}</span>
342 </td>
343 </tr>
344 <tr class="crm-event-manage-registration-form-block-bcc_confirm">
345 <td scope="row" class="label" width="20%">{$form.bcc_confirm.label}</td>
346 <td>{$form.bcc_confirm.html}<br/>
347 <span
348 class="description">{ts}You may specify one or more email addresses to receive a blind carbon copy (bcc) of the confirmation email. Multiple email addresses should be separated by a comma (e.g. jane@example.org, paula@example.org).{/ts}</span>
349 </td>
350 </tr>
351 </table>
352 </div>
353 </div>
354 </fieldset>
355 </div> {*end of div registration_blocks*}
356 </div>
357 <div class="crm-submit-buttons">
358 {include file="CRM/common/formButtons.tpl" location="bottom"}
359 </div>
360 {include file="CRM/common/showHide.tpl"}
361 {include file="CRM/common/showHideByFieldValue.tpl"
362 trigger_field_id ="is_online_registration"
363 trigger_value =""
364 target_element_id ="registration_blocks"
365 target_element_type ="block"
366 field_type ="radio"
367 invert = 0
368 }
369 {if !$is_monetary}
370 {include file="CRM/common/showHideByFieldValue.tpl"
371 trigger_field_id ="is_confirm_enabled"
372 trigger_value =""
373 target_element_id ="confirm_screen_settings"
374 target_element_type ="block"
375 field_type ="radio"
376 invert = 0
377 }
378 {/if}
379 {include file="CRM/common/showHideByFieldValue.tpl"
380 trigger_field_id ="is_email_confirm"
381 trigger_value =""
382 target_element_id ="confirmEmail"
383 target_element_type ="block"
384 field_type ="radio"
385 invert = 0
386 }
387 {include file="CRM/common/showHideByFieldValue.tpl"
388 trigger_field_id ="is_multiple_registrations"
389 trigger_value =""
390 target_element_id ="additional_profile_pre|additional_profile_post"
391 target_element_type ="table-row"
392 field_type ="radio"
393 invert = 0
394 }
395 {if $form.requires_approval}
396 {include file="CRM/common/showHideByFieldValue.tpl"
397 trigger_field_id ="requires_approval"
398 trigger_value =""
399 target_element_id ="id-approval-text"
400 target_element_type ="table-row"
401 field_type ="radio"
402 invert = 0
403 }
404 {/if}
405
406 {*include profile link function*}
407 {include file="CRM/common/buildProfileLink.tpl"}
408
409 <script type="text/javascript">
410 {literal} (function($, _) { // Generic Closure
411
412 $(".crm-submit-buttons input").click( function() {
413 $(".dedupenotify .ui-notify-close").click();
414 });
415
416 var profileBottomCount = Number({/literal}{$profilePostMultiple|@count}{literal});
417 var profileBottomCountAdd = Number({/literal}{$profilePostMultipleAdd|@count}{literal});
418
419 function addBottomProfile( e ) {
420 e.preventDefault();
421
422 var addtlPartc = $(this).data('addtlPartc');
423
424 if (addtlPartc) {
425 profileBottomCount++;
426 urlPath = CRM.url('civicrm/event/manage/registration', { addProfileBottomAdd: 1, addProfileNumAdd: profileBottomCountAdd, snippet: 4 } ) ;
427 } else {
428 profileBottomCountAdd++;
429 urlPath = CRM.url('civicrm/event/manage/registration', { addProfileBottom: 1 , addProfileNum : profileBottomCount, snippet: 4 } ) ;
430 }
431
432 $(this).closest('tbody').append('<tr class="additional_profile"></tr>');
433 var $el = $(this).closest('tbody').find('tr:last');
434 $el.load(urlPath, function() { $(this).trigger('crmLoad') });
435 }
436
437 function removeBottomProfile( e ) {
438 e.preventDefault();
439
440 $(e.target).parents('tr').find('.crm-profile-selector').val('');
441 $(e.target).parents('tr').hide();
442 }
443
444 var strSameAs = ' - '+ts('same as for main contact')+' - ';
445 var strSelect = ' - '+ts('select')+' - ';
446
447 $('#crm-container').on('crmLoad', function() {
448 var $container = $("[id^='additional_profile_'],.additional_profile").not('.processed').addClass('processed');
449 $container.find(".crm-profile-selector-select select").each( function() {
450 var $select = $(this);
451 var selected = $select.find(':selected').val(); //cache the default
452 $select.find('option[value=""]').remove();
453 $select.prepend('<option value="">'+strSameAs+'</option>');
454 if ($select.closest('tr').is(':not([id*="_pre"])')) {
455 $select.prepend('<option value="">'+strSelect+'</option>');
456 }
457 $select.find('option[value="'+selected+'"]').attr('selected', 'selected'); //restore default
458 });
459 });
460
461 $(function($) {
462
463 var allow_multiple = $("#is_multiple_registrations");
464 if ( !allow_multiple.prop('checked') ) {
465 $('#additional_profile_pre,#additional_profile_post').hide();
466 }
467 allow_multiple.change( function( ) {
468 if ( !$(this).prop('checked') ) {
469 $("#additional_custom_pre_id,#additional_custom_post_id").val('');
470 $(".crm-event-manage-registration-form-block-additional_custom_post_multiple").hide();
471 $('#additional_profile_pre,#additional_profile_post').hide();
472 } else {
473 $(".crm-event-manage-registration-form-block-additional_custom_post_multiple").show();
474 $('#additional_profile_pre,#additional_profile_post').show();
475 }
476
477 showRuleFields({/literal}{$ruleFields}{literal});
478 });
479
480 $('#allow_same_participant_emails').change( function() { showRuleFields({/literal}{$ruleFields}{literal}) });
481
482 $('#registration_blocks').on('click', '.crm-button-add-profile', addBottomProfile);
483 $('#registration_blocks').on('click', '.crm-button-rem-profile', removeBottomProfile);
484
485 $('#crm-container').on('crmLoad', function(e) {
486 $('tr[id^="additional_profile"] input[id^="additional_custom_"]').change(function(e) {
487 $input = $(e.target);
488 if ( $input.val() == '') {
489 $selected = $input.closest('tr').find('.crm-profile-selector-select :selected');
490 if ($selected.text() == strSelect) { $input.val('none'); }
491 }
492 });
493 });
494
495 }); // END onReady
496 }(CRM.$, CRM._)); //Generic Closure
497 {/literal}
498 </script>
499 {/if}