Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-02-25-11-27-40
[civicrm-core.git] / templates / CRM / Event / Form / EventFees.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
39de6fd5 3 | CiviCRM version 4.6 |
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{assign var=isRecordPayment value=1 }
27{if $paid} {* We retrieve this tpl when event is selected - keep it empty if event is not paid *}
28 <table class="form-layout">
29 {if $priceSet}
8567d0f8
PN
30 {if $discount and $hasPayment}
31 <tr class="crm-event-eventfees-form-block-discount"><td class="label">&nbsp;&nbsp;{ts}Discount Set{/ts}</td><td class="view-value">{$discount}</td></tr>
32 {elseif $form.discount_id.label}
33 <tr class="crm-event-eventfees-form-block-discount_id"><td class="label">&nbsp;&nbsp;{$form.discount_id.label}</td><td>{$form.discount_id.html}</td></tr>
34 {/if}
6a488035
TO
35 {if $action eq 2 and $hasPayment} {* Updating *}
36 {if $lineItem}
37 <tr class="crm-event-eventfees-form-block-line_items">
1a0d17b9 38 <td class="label">{ts}Selections{/ts}</td>
6a488035
TO
39 <td>{include file="CRM/Price/Page/LineItem.tpl" context="Event"}</td>
40 </tr>
1a0d17b9
PJ
41 <tr>
42 <td></td>
43 <td>
c8849f1c 44 <a class="action-item crm-hover-button" href='{crmURL p="civicrm/event/participant/feeselection" q="reset=1&id=`$participantId`&cid=`$contactId`&action=update"}'><span class="icon ui-icon-pencil"></span {ts}Change Selections{/ts}</a>
1a0d17b9
PJ
45 </td>
46 </tr>
6a488035
TO
47 {else}
48 <tr class="crm-event-eventfees-form-block-event_level">
49 <td class="label">{ts}Event Level{/ts}</td>
50 <td>{$fee_level}&nbsp;{if $fee_amount}- {$fee_amount|crmMoney:$fee_currency}{/if}</td>
51 </tr>
52 {/if}
53 {else} {* New participant *}
54 {if $priceSet.fields}
55 <fieldset id="priceset" class="crm-group priceset-group">
56 <tr class="crm-event-eventfees-form-block-price_set_amount">
57 <td class="label" style="padding-top: 10px;">{$form.amount.label}</td>
58 <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}</td>
59 </fieldset>
60 {else}
61 {assign var=isRecordPayment value=0 }
a4e0d7b5 62 <div class='messages status'>{ts}No active price fields found for this event!{/ts}</div>
6a488035
TO
63 {/if}
64 </table>
65 {/if}
66 </td>
67 </tr>
68 {/if}
69
a4e0d7b5 70 { if $accessContribution and ! $participantMode and ($action neq 2 or !$rows.0.contribution_id or $onlinePendingContributionId) and $isRecordPayment and ! $registeredByParticipantId }
6a488035
TO
71 <tr class="crm-event-eventfees-form-block-record_contribution">
72 <td class="label">{$form.record_contribution.label}</td>
73 <td>{$form.record_contribution.html}<br />
74 <span class="description">{ts}Check this box to enter payment information. You will also be able to generate a customized receipt.{/ts}</span>
75 </td>
76 </tr>
77 <tr id="payment_information" class="crm-event-eventfees-form-block-payment_information">
78 <td class ='html-adjust' colspan=2>
79 <fieldset><legend>{ts}Payment Information{/ts}</legend>
80 <table id="recordContribution" class="form-layout" style="width:auto;">
81 <tr class="crm-event-eventfees-form-block-financial_type_id">
82 <td class="label">{$form.financial_type_id.label}<span class="marker"> *</span></td>
83 <td>{$form.financial_type_id.html}<br /><span class="description">{ts}Select the appropriate financial type for this payment.{/ts}</span></td>
84 </tr>
b8c7e40c 85 <tr class="crm-event-eventfees-form-block-total_amount"><td class="label">{$form.total_amount.label}</td><td>{$form.total_amount.html|crmMoney:$currency}</td></tr>
6a488035
TO
86 <tr>
87 <td class="label" >{$form.receive_date.label}</td>
88 <td>{include file="CRM/common/jcalendar.tpl" elementName=receive_date}</td>
89 </tr>
d20225bb 90 <tr class="crm-event-eventfees-form-block-payment_instrument_id"><td class="label">{$form.payment_instrument_id.label}<span class="marker"> *</span></td><td>{$form.payment_instrument_id.html} {help id="payment_instrument_id" file="CRM/Contribute/Page/Tab.hlp"}</td></tr>
6a488035
TO
91 <tr id="checkNumber" class="crm-event-eventfees-form-block-check_number"><td class="label">{$form.check_number.label}</td><td>{$form.check_number.html|crmAddClass:six}</td></tr>
92 {if $showTransactionId }
93 <tr class="crm-event-eventfees-form-block-trxn_id"><td class="label">{$form.trxn_id.label}</td><td>{$form.trxn_id.html}</td></tr>
94 {/if}
95 <tr class="crm-event-eventfees-form-block-contribution_status_id"><td class="label">{$form.contribution_status_id.label}</td><td>{$form.contribution_status_id.html}</td></tr>
96 </table>
97 </fieldset>
98 </td>
99 </tr>
100
101 {* Record contribution field only present if we are NOT in submit credit card mode (! participantMode). *}
102 {include file="CRM/common/showHideByFieldValue.tpl"
103 trigger_field_id ="record_contribution"
104 trigger_value =""
105 target_element_id ="payment_information"
106 target_element_type ="table-row"
107 field_type ="radio"
108 invert = 0
109 }
110 {/if}
111 </table>
112
113{/if}
114
115{* credit card block when it is live or test mode*}
116{if $participantMode and $paid}
117 <div class="spacer"></div>
118 {include file='CRM/Core/BillingBlock.tpl'}
119{/if}
120{if ($email OR $batchEmail) and $outBound_option != 2}
121 <fieldset id="send_confirmation_receipt"><legend>{if $paid}{ts}Registration Confirmation and Receipt{/ts}{else}{ts}Registration Confirmation{/ts}{/if}</legend>
122 <table class="form-layout" style="width:auto;">
123 <tr class="crm-event-eventfees-form-block-send_receipt">
124 <td class="label">{if $paid}{ts}Send Confirmation and Receipt{/ts}{else}{ts}Send Confirmation{/ts}{/if}</td>
125 <td>{$form.send_receipt.html}<br>
126 {if $paid}
127 <span class="description">{ts 1=$email}Automatically email a confirmation and receipt to %1?{/ts}</span></td>
128 {else}
129 <span class="description">{ts 1=$email}Automatically email a confirmation to %1?{/ts}</span></td>
130 {/if}
131 </tr>
132 <tr id="from-email" class="crm-event-eventfees-form-block-from_email_address">
133 <td class="label">{$form.from_email_address.label}</td>
134 <td>{$form.from_email_address.html} {help id ="id-from_email" file="CRM/Contact/Form/Task/Email.hlp"}</td>
135 </tr>
136 <tr id='notice' class="crm-event-eventfees-form-block-receipt_text">
137 <td class="label">{$form.receipt_text.label}</td>
138 <td><span class="description">
139 {ts}Enter a message you want included at the beginning of the confirmation email. EXAMPLE: 'Thanks for registering for this event.'{/ts}
140 </span><br />
141 {$form.receipt_text.html|crmAddClass:huge}
142 </td>
143 </tr>
144 </table>
145 </fieldset>
146{elseif $context eq 'standalone' and $outBound_option != 2 }
147 <fieldset id="email-receipt" style="display:none;"><legend>{if $paid}{ts}Registration Confirmation and Receipt{/ts}{else}{ts}Registration Confirmation{/ts}{/if}</legend>
148 <table class="form-layout" style="width:auto;">
149 <tr class="crm-event-eventfees-form-block-send_receipt">
150 <td class="label">{if $paid}{ts}Send Confirmation and Receipt{/ts}{else}{ts}Send Confirmation{/ts}{/if}</td>
151 <td>{$form.send_receipt.html}<br>
152 {if $paid}
153 <span class="description">{ts 1='<span id="email-address"></span>'}Automatically email a confirmation and receipt to %1?{/ts}</span>
154 {else}
155 <span class="description">{ts 1='<span id="email-address"></span>'}Automatically email a confirmation to %1?{/ts}</span>
156 {/if}
157 </td>
158 </tr>
159 <tr id="from-email" class="crm-event-eventfees-form-block-from_email_address">
160 <td class="label">{$form.from_email_address.label}</td>
161 <td>{$form.from_email_address.html} {help id ="id-from_email" file="CRM/Contact/Form/Task/Email.hlp"}</td>
162 </tr>
163 <tr id='notice' class="crm-event-eventfees-form-block-receipt_text">
164 <td class="label">{$form.receipt_text.label}</td>
165 <td><span class="description">
166 {ts}Enter a message you want included at the beginning of the confirmation email. EXAMPLE: 'Thanks for registering for this event.'{/ts}
167 </span><br />
168 {$form.receipt_text.html|crmAddClass:huge}</td>
169 </tr>
170 </table>
171 </fieldset>
172{/if}
173
174{if ($email and $outBound_option != 2) OR $context eq 'standalone' } {* Send receipt field only present if contact has a valid email address. *}
175{include file="CRM/common/showHideByFieldValue.tpl"
176 trigger_field_id ="send_receipt"
177 trigger_value =""
178 target_element_id ="notice"
179 target_element_type ="table-row"
180 field_type ="radio"
181 invert = 0
182}
183{include file="CRM/common/showHideByFieldValue.tpl"
184 trigger_field_id ="send_receipt"
185 trigger_value =""
186 target_element_id ="from-email"
187 target_element_type ="table-row"
188 field_type ="radio"
189 invert = 0
190}
191{/if}
192
193{if $paid and ($action eq 1 or ( $action eq 2 and !$hasPayment) ) and !$participantMode}
194{include file="CRM/common/showHideByFieldValue.tpl"
195 trigger_field_id ="payment_instrument_id"
196 trigger_value = '4'
197 target_element_id ="checkNumber"
198 target_element_type ="table-row"
199 field_type ="select"
200 invert = 0
201}
202{/if}
203
204{if $context eq 'standalone' and $outBound_option != 2 }
205<script type="text/javascript">
206{literal}
01bfdd10
CW
207 CRM.$(function($) {
208 var $form = $("form.{/literal}{$form.formClass}{literal}");
209 $("#contact_id", $form).change(checkEmail);
210 checkEmail();
6a488035 211
01bfdd10
CW
212 function checkEmail( ) {
213 var data = $("#contact_id", $form).select2('data');
214 if (data && data.extra && data.extra.email && data.extra.email.length) {
215 $("#email-receipt", $form).show();
216 if ($("#send_receipt", $form).is(':checked')) {
217 $("#notice", $form).show();
218 }
219 $("#email-address", $form).html(data.extra.email);
220 }
221 else {
222 $("#email-receipt, #notice", $form).hide();
223 }
6a488035 224 }
01bfdd10 225 });
6a488035
TO
226{/literal}
227</script>
228{/if}
229
230{if $onlinePendingContributionId}
231<script type="text/javascript">
232{literal}
233 function confirmStatus( pStatusId, cStatusId ) {
234 if ( (pStatusId == cj("#status_id").val() ) && (cStatusId == cj("#contribution_status_id").val()) ) {
235 var allow = confirm( '{/literal}{ts escape='js'}The Payment Status for this participant is Completed. The Participant Status is set to Pending from pay later. Click Cancel if you want to review or modify these values before saving this record{/ts}{literal}.' );
236 if ( !allow ) return false;
237 }
238 }
239
240 function checkCancelled( statusId, pStatusId, cStatusId ) {
241 //selected participant status is 'cancelled'
242 if ( statusId == pStatusId ) {
243 cj("#contribution_status_id").val( cStatusId );
244
245 //unset value for send receipt check box.
8539f25d 246 cj("#send_receipt").prop("checked", false );
6a488035
TO
247 cj("#send_confirmation_receipt").hide( );
248
249 // set receive data to null.
250 clearDateTime( 'receive_date' );
251 } else {
252 cj("#send_confirmation_receipt").show( );
253 }
254 sendNotification();
255 }
256
257{/literal}
258</script>
259{/if}
260{if $showFeeBlock && $feeBlockPaid && ! $priceSet && $action neq 2}
261<script>
262{literal}
263 fillTotalAmount( );
264
265 function fillTotalAmount( totalAmount ) {
266 if ( !totalAmount ) {
267 var amountVal = {/literal}{if $form.amount.value}{$form.amount.value}{else}0{/if}{literal};
268 if ( amountVal > 0 ) {
269 var eventFeeBlockValues = {/literal}{$eventFeeBlockValues}{literal};
270 totalAmount = eval('eventFeeBlockValues.amount_id_'+ amountVal);
271 } else {
272 totalAmount = '';
273 }
274 }
275 cj('#total_amount').val( totalAmount );
276 }
277{/literal}
278</script>
279{/if}
280
281{* ADD mode if *}