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