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