CRM-13965 : view transactions popup, payment information block
[civicrm-core.git] / templates / CRM / Event / Form / Participant.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
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 {* This template is used for adding/editing/deleting offline Event Registrations *}
27 {if $showFeeBlock }
28 {if $priceSet}
29 <div id='validate_pricefield' class='messages crm-error hiddenElement'></div>
30 {literal}
31 <script type="text/javascript">
32
33 var fieldOptionsFull = new Array( );
34 {/literal}
35 {foreach from=$priceSet.fields item=fldElement key=fldId}
36 {if $fldElement.options}
37 {foreach from=$fldElement.options item=fldOptions key=opId}
38 {if $fldOptions.is_full}
39 {literal}
40 fieldOptionsFull[{/literal}{$fldId}{literal}] = new Array( );
41 fieldOptionsFull[{/literal}{$fldId}{literal}][{/literal}{$opId}{literal}] = 1;
42 {/literal}
43 {/if}
44 {/foreach}
45 {/if}
46 {/foreach}
47 {literal}
48
49 if ( fieldOptionsFull.length > 0 ) {
50 cj(function() {
51 cj("input,#priceset select,#priceset").each(function () {
52 if ( cj(this).attr('price') ) {
53 switch( cj(this).attr('type') ) {
54 case 'checkbox':
55 case 'radio':
56 cj(this).click( function() {
57 validatePriceField(this);
58 });
59 break;
60
61 case 'select-one':
62 cj(this).change( function() {
63 validatePriceField(this);
64 });
65 break;
66 case 'text':
67 cj(this).bind( 'keyup', function() { validatePriceField(this) });
68 break;
69 }
70 }
71 });
72 });
73
74 function validatePriceField( obj ) {
75 var namePart = cj(obj).attr('name').split('_');
76 var fldVal = cj(obj).val();
77 if ( cj(obj).attr('type') == 'checkbox') {
78 var eleIdpart = namePart[1].split('[');
79 var eleId = eleIdpart[0];
80 }
81 else {
82 var eleId = namePart[1];
83 }
84 var showError = false;
85
86 switch( cj(obj).attr('type') ) {
87 case 'text':
88 if ( fieldOptionsFull[eleId] && fldVal ) {
89 showError = true;
90 cj(obj).parent( ).parent( ).children('.label').addClass('crm-error');
91 }
92 else {
93 cj(obj).parent( ).parent( ).children('.label').removeClass('crm-error');
94 cj('#validate_pricefield').hide( ).html('');
95 }
96 break;
97
98 case 'checkbox':
99 var checkBoxValue = eleIdpart[1].split(']');
100 if ( cj(obj).prop("checked") == true &&
101 fieldOptionsFull[eleId] &&
102 fieldOptionsFull[eleId][checkBoxValue[0]]) {
103 showError = true;
104 cj(obj).parent( ).addClass('crm-error');
105 }
106 else {
107 cj(obj).parent( ).removeClass('crm-error');
108 }
109 break;
110
111 default:
112 if ( fieldOptionsFull[eleId] &&
113 fieldOptionsFull[eleId][fldVal] ) {
114 showError = true;
115 cj(obj).parent( ).addClass('crm-error');
116 }
117 else {
118 cj(obj).parent( ).removeClass('crm-error');
119 }
120 }
121
122 if ( showError ) {
123 cj('#validate_pricefield').show().html("<span class='icon red-icon alert-icon'></span>{/literal}{ts escape='js'}This Option is already full for this event.{/ts}{literal}");
124 }
125 else {
126 cj('#validate_pricefield').hide( ).html('');
127 }
128 }
129 }
130
131 // change the status to default 'partially paid' for partial payments
132 var feeAmount;
133 var userModifiedAmount;
134 var partiallyPaidStatusId = {/literal}{$partiallyPaidStatusId}{literal};
135
136 cj('#total_amount')
137 .focus(
138 function() {
139 feeAmount = cj(this).val();
140 feeAmount = parseInt(feeAmount);
141 }
142 )
143 .change(
144 function() {
145 userModifiedAmount = cj(this).val();
146 userModifiedAmount = parseInt(userModifiedAmount);
147 if (userModifiedAmount < feeAmount) {
148 cj('#status_id').val(partiallyPaidStatusId);
149 }
150 }
151 );
152
153 cj('#Participant').submit(
154 function(e) {
155 var userSubmittedStatus = cj('#status_id').val();
156 var statusLabel = cj('#status_id option:selected').text();
157 if (userModifiedAmount < feeAmount && userSubmittedStatus != partiallyPaidStatusId) {
158 var result = confirm('Payment amount is less than the amount owed. Expected participant status is \'Partially paid\'. Are you sure you want to set the participant status to ' + statusLabel + '? Click OK to continue, Cancel to change your entries.');
159 if (result == false) {
160 e.preventDefault();
161 }
162 }
163 }
164 );
165 </script>
166 {/literal}
167 {/if}
168 {if $participantId and $feePaymentBlock}
169 {include file="CRM/Contribute/Page/PaymentInfo.tpl" show='event-payment'}
170 {/if}
171 {include file="CRM/Event/Form/EventFees.tpl"}
172 {elseif $cdType}
173 {include file="CRM/Custom/Form/CustomData.tpl"}
174 {else}
175 {if $participantMode == 'test' }
176 {assign var=registerMode value="TEST"}
177 {elseif $participantMode == 'live'}
178 {assign var=registerMode value="LIVE"}
179 {/if}
180 <h3>{if $action eq 1}{ts}New Event Registration{/ts}{elseif $action eq 8}{ts}Delete Event Registration{/ts}{else}{ts}Edit Event Registration{/ts}{/if}</h3>
181 <div class="crm-block crm-form-block crm-participant-form-block">
182 <div class="view-content">
183 {if $participantMode}
184 <div id="help">
185 {ts 1=$displayName 2=$registerMode}Use this form to submit an event registration on behalf of %1. <strong>A %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
186 </div>
187 {/if}
188 <div id="eventFullMsg" class="messages status no-popup" style="display:none;"></div>
189
190
191 {if $action eq 1 AND $paid}
192 <div id="help">
193 {ts}If you are accepting offline payment from this participant, check <strong>Record Payment</strong>. You will be able to fill in the payment information, and optionally send a receipt.{/ts}
194 </div>
195 {/if}
196
197 {if $action eq 8} {* If action is Delete *}
198 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
199 <div class="crm-participant-form-block-delete messages status no-popup">
200 <div class="crm-content">
201 <div class="icon inform-icon"></div> &nbsp;
202 {ts}WARNING: Deleting this registration will result in the loss of related payment records (if any).{/ts} {ts}Do you want to continue?{/ts}
203 </div>
204 {if $additionalParticipant}
205 <div class="crm-content">
206 {ts 1=$additionalParticipant} There are %1 more Participant(s) registered by this participant.{/ts}
207 </div>
208 {/if}
209 </div>
210 {if $additionalParticipant}
211 {$form.delete_participant.html}
212 {/if}
213 {else} {* If action is other than Delete *}
214 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
215 <table class="form-layout-compressed">
216 {if $single and $context neq 'standalone'}
217 <tr class="crm-participant-form-block-displayName">
218 <td class="label font-size12pt"><label>{ts}Participant{/ts}</label></td>
219 <td class="font-size12pt view-value">{$displayName}&nbsp;</td>
220 </tr>
221 {else}
222 {if !$participantMode and !$email and $outBound_option != 2 }
223 {assign var='profileCreateCallback' value=1}
224 {/if}
225 {include file="CRM/Contact/Form/NewContact.tpl"}
226 {/if}
227 {if $action EQ 2}
228 {if $additionalParticipants} {* Display others registered by this participant *}
229 <tr class="crm-participant-form-block-additionalParticipants">
230 <td class="label"><label>{ts}Also Registered by this Participant{/ts}</label></td>
231 <td>
232 {foreach from=$additionalParticipants key=apName item=apURL}
233 <a href="{$apURL}" title="{ts}view additional participant{/ts}">{$apName}</a><br />
234 {/foreach}
235 </td>
236 </tr>
237 {/if}
238 {if $registered_by_contact_id}
239 <tr class="crm-participant-form-block-registered-by">
240 <td class="label"><label>{ts}Registered By{/ts}</label></td>
241 <td class="view-value">
242 <a href="{crmURL p='civicrm/contact/view/participant' q="reset=1&id=$participant_registered_by_id&cid=$registered_by_contact_id&action=view"}"
243 title="{ts}view primary participant{/ts}">{$registered_by_display_name}</a>
244 </td>
245 </tr>
246 {/if}
247 {/if}
248 {if $participantMode}
249 <tr class="crm-participant-form-block-payment_processor_id">
250 <td class="label nowrap">{$form.payment_processor_id.label}</td>
251 <td>{$form.payment_processor_id.html}</td>
252 </tr>
253 {/if}
254 <tr class="crm-participant-form-block-event_id">
255 <td class="label">{$form.event_id.label}</td><td class="view-value bold">{$form.event_id.html}&nbsp;
256 {if $action eq 1}<span id='past-event-section'>
257 <br />&raquo; <span id="showing-event-info"></span>
258 {/if}
259 {if $is_test}
260 {ts}(test){/ts}
261 {/if}
262 </td>
263 </tr>
264
265 {* CRM-7362 --add campaign *}
266 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl"
267 campaignTrClass="crm-participant-form-block-campaign_id"}
268
269 <tr class="crm-participant-form-block-role_id">
270 <td class="label">{$form.role_id.label}</td>
271 <td>{$form.role_id.html}</td>
272 </tr>
273 <tr class="crm-participant-form-block-register_date">
274 <td class="label">{$form.register_date.label}</td>
275 <td>
276 {if $hideCalendar neq true}
277 {include file="CRM/common/jcalendar.tpl" elementName=register_date}
278 {else}
279 {$form.register_date.html|crmDate}
280 {/if}
281 </td>
282 </tr>
283 <tr class="crm-participant-form-block-status_id">
284 <td class="label">{$form.status_id.label}</td>
285 <td>{$form.status_id.html}{if $event_is_test} {ts}(test){/ts}{/if}
286 <div id="notify">{$form.is_notify.html}{$form.is_notify.label}</div>
287 </td>
288 </tr>
289 <tr class="crm-participant-form-block-source">
290 <td class="label">{$form.source.label}</td><td>{$form.source.html|crmAddClass:huge}<br />
291 <span class="description">{ts}Source for this registration (if applicable).{/ts}</span></td>
292 </tr>
293 </table>
294 {if $participantId and $feePaymentBlock}
295 <table class='form-layout'>
296 <tr>
297 <td class='label'>{ts}Fees{/ts}</td>
298 {* this is where the payment info is shown using CRM/Contribute/Page/PaymentInfo.tpl tpl*}
299 <td id='payment-info'></td>
300 </tr>
301 </table>
302 {/if}
303 {* Fee block (EventFees.tpl) is injected here when an event is selected. *}
304 <div id="feeBlock"></div>
305 <fieldset>
306 <table class="form-layout">
307 <tr class="crm-participant-form-block-note">
308 <td class="label">{$form.note.label}</td><td>{$form.note.html}</td>
309 </tr>
310 </table>
311 </fieldset>
312
313 <div class="crm-participant-form-block-customData">
314 <div id="customData" class="crm-customData-block"></div> {* Participant Custom data *}
315 <div id="customData{$eventNameCustomDataTypeID}" class="crm-customData-block"></div> {* Event Custom Data *}
316 <div id="customData{$roleCustomDataTypeID}" class="crm-customData-block"></div> {* Role Custom Data *}
317 <div id="customData{$eventTypeCustomDataTypeID}" class="crm-customData-block"></div> {* Role Custom Data *}
318 </div>
319 {/if}
320
321 {if $accessContribution and $action eq 2 and $rows.0.contribution_id}
322 {include file="CRM/Contribute/Form/Selector.tpl" context="Search"}
323 {/if}
324
325 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
326 </div>
327 </div>
328 {if $action eq 1 or $action eq 2}
329 {literal}
330 <script type="text/javascript">
331 // event select
332 function buildSelect( selectID, listallVal ) {
333 var elementID = '#' + selectID;
334 cj( elementID ).html('');
335 var postUrl = "{/literal}{crmURL p='civicrm/ajax/eventlist' h=0}{literal}";
336 cj.post( postUrl, {listall:listallVal}, function ( response ) {
337 response = eval( response );
338 for (i = 0; i < response.length; i++) {
339 cj( elementID ).get(0).add(new Option(response[i].name, response[i].value), document.all ? i : null);
340 }
341 getShowEventInfo(listallVal);
342 cj('input[name="past_event"]').val(listallVal);
343 cj("#feeBlock").html( '' );
344 });
345 }
346
347 {/literal}
348 {if $action eq 1}getShowEventInfo({$past});{/if}
349 {literal}
350
351 function getShowEventInfo (listallVal) {
352 switch(listallVal) {
353 case 1:
354 cj('#showing-event-info').html({/literal}'{ts}Showing all events: show{/ts}'{literal}+' <a href="#" onclick="buildSelect(\'event_id\', 0); return false;">'+{/literal}'{ts}current and future{/ts}'{literal}+'</a> | <a href="#" onclick="buildSelect(\'event_id\', 2); return false;">'+{/literal}'{ts}past three months{/ts}'{literal}+'</a>');
355 break;
356 case 2:
357 cj('#showing-event-info').html({/literal}'{ts}Showing events since three months ago: show{/ts}'{literal}+' <a href="#" onclick="buildSelect(\'event_id\', 0); return false;">'+{/literal}'{ts}current and future{/ts}'{literal}+'</a> | <a href="#" onclick="buildSelect(\'event_id\', 1); return false;">'+{/literal}'{ts}all{/ts}'{literal}+'</a>');
358 break;
359 default:
360 cj('#showing-event-info').html({/literal}'{ts}Showing current and future events: show{/ts}'{literal}+' <a href="#" onclick="buildSelect(\'event_id\', 2); return false;">'+{/literal}'{ts}past three months{/ts}'{literal}+'</a> | <a href="#" onclick="buildSelect(\'event_id\', 1); return false;">'+{/literal}'{ts}all{/ts}'{literal}+'</a>');
361 break;
362 }
363 }
364 {/literal}
365
366 {if $preloadJSSnippet}
367 {$preloadJSSnippet}
368 {else}
369 //build fee block
370 buildFeeBlock( );
371 {/if}
372
373 {literal}
374 //build discount block
375 if ( document.getElementById('discount_id') ) {
376 var discountId = document.getElementById('discount_id').value;
377 if ( discountId ) {
378 var eventId = document.getElementById('event_id').value;
379 buildFeeBlock( eventId, discountId );
380 }
381 }
382
383 function buildFeeBlock( eventId, discountId ) {
384 var dataUrl = {/literal}"{crmURL p=$urlPath h=0 q='snippet=4'}";
385 dataUrl = dataUrl + '&qfKey=' + '{$qfKey}'
386
387 {if $urlPathVar}
388 dataUrl = dataUrl + '&' + '{$urlPathVar}'
389 {/if}
390
391 {literal}
392 if ( !eventId ) {
393 var eventId = document.getElementById('event_id').value;
394 }
395
396 if ( eventId) {
397 dataUrl = dataUrl + '&eventId=' + eventId;
398 }
399 else {
400 cj('#eventFullMsg').hide( );
401 cj('#feeBlock').html('');
402 return;
403 }
404
405 var participantId = "{/literal}{$participantId}{literal}";
406
407 if ( participantId ) {
408 dataUrl = dataUrl + '&participantId=' + participantId;
409 }
410
411 if ( discountId ) {
412 dataUrl = dataUrl + '&discountId=' + discountId;
413 }
414
415 cj.ajax({
416 url: dataUrl,
417 async: false,
418 global: false,
419 success: function ( html ) {
420 cj("#feeBlock").html( html );
421 }
422 });
423
424 cj("#feeBlock").ajaxStart(function(){
425 cj(".disable-buttons input").prop('disabled', true);
426 });
427
428 cj("#feeBlock").ajaxStop(function(){
429 cj(".disable-buttons input").prop('disabled', false);
430 });
431
432 //show event real full as well as waiting list message.
433 if ( cj("#hidden_eventFullMsg").val( ) ) {
434 cj( "#eventFullMsg" ).show( ).html( cj("#hidden_eventFullMsg" ).val( ) );
435 }
436 else {
437 cj( "#eventFullMsg" ).hide( );
438 }
439 }
440
441 </script>
442 {/literal}
443
444 {*include custom data js file*}
445 {include file="CRM/common/customData.tpl"}
446 {literal}
447 <script type="text/javascript">
448 var roleGroupMapper = new Array( );
449 {/literal}
450 {foreach from=$participantRoleIds item="grps" key="rlId"}
451 {literal}
452 roleGroupMapper[{/literal}{$rlId}{literal}] = '{/literal}{$grps}{literal}';
453 {/literal}
454 {/foreach}
455 {literal}
456
457 function buildParticipantRole( eventID ) {
458 var dataUrl = "{/literal}{crmURL p='civicrm/ajax/rest' q='className=CRM_Event_Page_AJAX&fnName=participantRole&json=1&context=participant' h=0 }"{literal};
459
460 if ( !eventId ) {
461 var eventId = document.getElementById( 'event_id' ).value;
462 }
463
464 if ( eventId ) {
465 dataUrl = dataUrl + '&eventId=' + eventID;
466 }
467
468 cj.ajax({
469 url: dataUrl,
470 async: false,
471 global: false,
472 dataType: "json",
473 success: function ( response ) {
474 if ( response.role ) {
475 for ( var i in roleGroupMapper ) {
476 if ( i != 0 ) {
477 if ( i == response.role ) {
478 document.getElementById("role_id_" +i ).checked = true;
479 }
480 else {
481 document.getElementById("role_id_" +i ).checked = false;
482 }
483 showCustomData( 'Participant', i, {/literal} {$roleCustomDataTypeID} {literal} );
484 }
485 }
486 }
487 }
488 });
489 }
490
491 function showCustomData( type, subType, subName ) {
492 var dataUrl = {/literal}"{crmURL p=$urlPath h=0 q='snippet=4&type='}"{literal} + type;
493 var roleid = "role_id_"+subType;
494 var loadData = false;
495
496 if ( document.getElementById( roleid ).checked == true ) {
497 if ( roleGroupMapper[subType] ) {
498 var splitGroup = roleGroupMapper[subType].split(",");
499 for ( i = 0; i < splitGroup.length; i++ ) {
500 var roleCustomGroupId = splitGroup[i];
501 if ( cj( '#'+roleCustomGroupId ).length > 0 ) {
502 cj( '#'+roleCustomGroupId ).remove( );
503 }
504 }
505 loadData = true;
506 }
507 }
508 else {
509 var groupUnload = new Array( );
510 var x = 0;
511
512 if ( roleGroupMapper[0] ) {
513 var splitGroup = roleGroupMapper[0].split(",");
514 for ( x = 0; x < splitGroup.length; x++ ) {
515 groupUnload[x] = splitGroup[x];
516 }
517 }
518
519 for ( var i in roleGroupMapper ) {
520 if ( ( i > 0 ) && ( document.getElementById( "role_id_"+i ).checked ) ) {
521 var splitGroup = roleGroupMapper[i].split(",");
522 for ( j = 0; j < splitGroup.length; j++ ) {
523 groupUnload[x+j+1] = splitGroup[j];
524 }
525 }
526 }
527
528 if ( roleGroupMapper[subType] ) {
529 var splitGroup = roleGroupMapper[subType].split(",");
530 for ( i = 0; i < splitGroup.length; i++ ) {
531 var roleCustomGroupId = splitGroup[i];
532 if ( cj( '#'+roleCustomGroupId ).length > 0 ) {
533 if ( cj.inArray( roleCustomGroupId, groupUnload ) == -1 ) {
534 cj( '#'+roleCustomGroupId ).remove( );
535 }
536 }
537 }
538 }
539 }
540
541 if ( !( loadData ) ) {
542 return false;
543 }
544
545 if ( subType ) {
546 dataUrl = dataUrl + '&subType=' + subType;
547 }
548
549 if ( subName ) {
550 dataUrl = dataUrl + '&subName=' + subName;
551 cj( '#customData' + subName ).show( );
552 }
553 else {
554 cj( '#customData' ).show( );
555 }
556
557 {/literal}
558 {if $urlPathVar}
559 dataUrl = dataUrl + '&' + '{$urlPathVar}'
560 {/if}
561 {if $groupID}
562 dataUrl = dataUrl + '&groupID=' + '{$groupID}'
563 {/if}
564 {if $qfKey}
565 dataUrl = dataUrl + '&qfKey=' + '{$qfKey}'
566 {/if}
567 {if $entityID}
568 dataUrl = dataUrl + '&entityID=' + '{$entityID}'
569 {/if}
570
571 {literal}
572
573 if ( subName && subName != 'null' ) {
574 var fname = '#customData' + subName;
575 }
576 else {
577 var fname = '#customData';
578 }
579
580 var response = cj.ajax({url: dataUrl,
581 async: false
582 }).responseText;
583
584 if ( subType != 'null' ) {
585 if ( document.getElementById(roleid).checked == true ) {
586 var response_text = '<div style="display:block;" id = '+subType+'_chk >'+response+'</div>';
587 cj( fname ).append(response_text);
588 }
589 else {
590 cj('#'+subType+'_chk').remove();
591 }
592 }
593 }
594
595 cj(function() {
596 {/literal}
597 CRM.buildCustomData( '{$customDataType}', 'null', 'null' );
598 {literal}
599 for ( var i in roleGroupMapper ) {
600 if ( ( i > 0 ) && ( document.getElementById( "role_id_"+i ).checked ) ) {
601 {/literal}
602 showCustomData( '{$customDataType}', i, {$roleCustomDataTypeID} );
603 {literal}
604 }
605 }
606 {/literal}
607 {if $eventID}
608 CRM.buildCustomData( '{$customDataType}', {$eventID}, {$eventNameCustomDataTypeID} );
609 {/if}
610 {if $eventTypeID}
611 CRM.buildCustomData( '{$customDataType}', {$eventTypeID}, {$eventTypeCustomDataTypeID} );
612 {/if}
613 {literal}
614
615 //call pane js
616 cj().crmAccordions();
617 });
618 </script>
619 {/literal}
620
621 {/if}
622
623 {* include jscript to warn if unsaved form field changes *}
624 {include file="CRM/common/formNavigate.tpl"}
625
626 <script type="text/javascript">
627 {literal}
628
629 sendNotification();
630 function sendNotification() {
631 var notificationStatusIds = {/literal}"{$notificationStatusIds}"{literal};
632 notificationStatusIds = notificationStatusIds.split(',');
633 if (cj.inArray(cj('select#status_id option:selected').val(), notificationStatusIds) > -1) {
634 cj("#notify").show();
635 cj("#is_notify").prop('checked', true);
636 }
637 else {
638 cj("#notify").hide();
639 cj("#is_notify").prop('checked', false);
640 }
641 }
642
643 function buildEventTypeCustomData( eventID, eventTypeCustomDataTypeID, eventAndTypeMapping ) {
644 var mapping = eval('(' + eventAndTypeMapping + ')');
645 CRM.buildCustomData( 'Participant', mapping[eventID], eventTypeCustomDataTypeID );
646 }
647
648 function loadCampaign( eventId, campaigns ) {
649 cj( "#campaign_id" ).val( campaigns[eventId] );
650 }
651
652 {/literal}
653 {if $profileCreateCallback}
654 {literal}
655 function profileCreateCallback( blockNo ) {
656 if( cj('#event_id').val( ) && cj('#email-receipt').length > 0 ) {
657 checkEmail( );
658 }
659 }
660 {/literal}
661 {/if}
662 </script>
663 {literal}
664 <script type="text/javascript">
665 cj(function() {
666 cj().crmAccordions();
667 });
668 </script>
669 {/literal}
670
671 {/if} {* end of main event block*}
672