Merge pull request #65 from twomice/CRM-12013
[civicrm-core.git] / templates / CRM / Event / Form / Registration / AdditionalParticipant.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
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 {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 {capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture}
36
37 {*CRM-4320*}
38 {if $statusMessage}
39 <div class="messages status no-popup">
40 <p>{$statusMessage}</p>
41 </div>
42 {/if}
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="marker">*</span></td>
60 <td>&nbsp;</td>
61 <td>{$form.amount.html}</td>
62 </tr>
63 </table>
64 {/if}
65 {/if}
66
67 {assign var=n value=email-$bltID}
68 <table class="form-layout-compressed">
69 <tr>
70 <td class="label nowrap">{$form.$n.label}</td><td>{$form.$n.html}</td>
71 </tr>
72 </table>
73
74 {include file="CRM/UF/Form/Block.tpl" fields=$additionalCustomPre}
75 {include file="CRM/UF/Form/Block.tpl" fields=$additionalCustomPost}
76
77 <div id="crm-submit-buttons">
78 {include file="CRM/common/formButtons.tpl"}
79 </div>
80 </div>
81
82 {if $priceSet && $allowGroupOnWaitlist}
83 {literal}
84 <script type="text/javascript">
85
86 function allowGroupOnWaitlist( participantCount, currentCount )
87 {
88 var formId = {/literal}'{$formId}'{literal};
89 var waitingMsg = {/literal}'{$waitingMsg}'{literal};
90 var confirmedMsg = {/literal}'{$confirmedMsg}'{literal};
91 var paymentBypassed = {/literal}'{$paymentBypassed}'{literal};
92
93 var availableRegistrations = {/literal}{$availableRegistrations}{literal};
94 if ( !participantCount ) participantCount = {/literal}'{$currentParticipantCount}'{literal};
95 var totalParticipants = parseInt(participantCount) + parseInt(currentCount);
96
97 var seatStatistics = '{/literal}{ts 1="' + totalParticipants + '"}Total Participants : %1{/ts}{literal}' + '<br />' + '{/literal}{ts 1="' + availableRegistrations + '"}Event Availability : %1{/ts}{literal}';
98 cj("#event_participant_status").html( seatStatistics );
99
100 if ( !{/literal}'{$lastParticipant}'{literal} ) return;
101
102 if ( totalParticipants > availableRegistrations ) {
103
104 cj('#waiting-status').show( ).html(waitingMsg);
105
106 if ( paymentBypassed ) {
107 cj('input[name=_qf_Participant_'+ formId +'_next]').parent( ).show( );
108 cj('input[name=_qf_Participant_'+ formId +'_next_skip]').parent( ).show( );
109 }
110 } else {
111 if ( paymentBypassed ) {
112 confirmedMsg += '<br /> ' + paymentBypassed;
113 }
114 cj('#waiting-status').show( ).html(confirmedMsg);
115
116 if ( paymentBypassed ) {
117 cj('input[name=_qf_Participant_'+ formId +'_next]').parent( ).hide( );
118 cj('input[name=_qf_Participant_'+ formId +'_next_skip]').parent( ).hide( );
119 }
120 }
121 }
122
123 </script>
124 {/literal}
125 {/if}