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