| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 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 $skipCount} |
| 27 | <h3>Skipped Participant(s): {$skipCount}</h3> |
| 28 | {/if} |
| 29 | {if $action & 1024} |
| 30 | {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"} |
| 31 | {/if} |
| 32 | |
| 33 | {include file="CRM/common/TrackingFields.tpl"} |
| 34 | |
| 35 | {*CRM-4320*} |
| 36 | {if $statusMessage} |
| 37 | <div class="messages status no-popup"> |
| 38 | <p>{$statusMessage}</p> |
| 39 | </div> |
| 40 | {/if} |
| 41 | |
| 42 | {include file="CRM/UF/Form/Block.tpl" fields=$additionalCustomPre} |
| 43 | |
| 44 | {if $priceSet && $allowGroupOnWaitlist} |
| 45 | {include file="CRM/Price/Form/ParticipantCount.tpl"} |
| 46 | <div id="waiting-status" style="display:none;" class="messages status no-popup"></div> |
| 47 | <div class="messages status no-popup" style="width:25%"><span id="event_participant_status"></span></div> |
| 48 | {/if} |
| 49 | |
| 50 | <div class="crm-block crm-event-additionalparticipant-form-block"> |
| 51 | {if $priceSet} |
| 52 | <fieldset id="priceset" class="crm-group priceset-group"><legend>{$event.fee_label}</legend> |
| 53 | {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"} |
| 54 | </fieldset> |
| 55 | {else} |
| 56 | {if $paidEvent} |
| 57 | <table class="form-layout-compressed"> |
| 58 | <tr class="crm-event-additionalparticipant-form-block-amount"> |
| 59 | <td class="label nowrap">{$event.fee_label} <span class="crm-marker">*</span></td> |
| 60 | <td> </td> |
| 61 | <td>{$form.amount.html}</td> |
| 62 | </tr> |
| 63 | </table> |
| 64 | {/if} |
| 65 | {/if} |
| 66 | |
| 67 | {include file="CRM/UF/Form/Block.tpl" fields=$additionalCustomPost} |
| 68 | |
| 69 | <div id="crm-submit-buttons"> |
| 70 | {include file="CRM/common/formButtons.tpl"} |
| 71 | </div> |
| 72 | </div> |
| 73 | |
| 74 | {if $priceSet && $allowGroupOnWaitlist} |
| 75 | {literal} |
| 76 | <script type="text/javascript"> |
| 77 | |
| 78 | function allowGroupOnWaitlist( participantCount, currentCount ) |
| 79 | { |
| 80 | var formId = {/literal}'{$formName}'{literal}; |
| 81 | var waitingMsg = {/literal}'{$waitingMsg}'{literal}; |
| 82 | var confirmedMsg = {/literal}'{$confirmedMsg}'{literal}; |
| 83 | var paymentBypassed = {/literal}'{$paymentBypassed}'{literal}; |
| 84 | |
| 85 | var availableRegistrations = {/literal}{$availableRegistrations}{literal}; |
| 86 | if ( !participantCount ) participantCount = {/literal}'{$currentParticipantCount}'{literal}; |
| 87 | var totalParticipants = parseInt(participantCount) + parseInt(currentCount); |
| 88 | |
| 89 | var seatStatistics = '{/literal}{ts 1="' + totalParticipants + '"}Total Participants : %1{/ts}{literal}' + '<br />' + '{/literal}{ts 1="' + availableRegistrations + '"}Event Availability : %1{/ts}{literal}'; |
| 90 | cj("#event_participant_status").html( seatStatistics ); |
| 91 | |
| 92 | if ( !{/literal}'{$lastParticipant}'{literal} ) return; |
| 93 | |
| 94 | if ( totalParticipants > availableRegistrations ) { |
| 95 | |
| 96 | cj('#waiting-status').show( ).html(waitingMsg); |
| 97 | |
| 98 | if ( paymentBypassed ) { |
| 99 | cj('input[name=_qf_Participant_'+ formId +'_next]').parent( ).show( ); |
| 100 | cj('input[name=_qf_Participant_'+ formId +'_next_skip]').parent( ).show( ); |
| 101 | } |
| 102 | } else { |
| 103 | if ( paymentBypassed ) { |
| 104 | confirmedMsg += '<br /> ' + paymentBypassed; |
| 105 | } |
| 106 | cj('#waiting-status').show( ).html(confirmedMsg); |
| 107 | |
| 108 | if ( paymentBypassed ) { |
| 109 | cj('input[name=_qf_Participant_'+ formId +'_next]').parent( ).hide( ); |
| 110 | cj('input[name=_qf_Participant_'+ formId +'_next_skip]').parent( ).hide( ); |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | </script> |
| 116 | {/literal} |
| 117 | {/if} |