*}
{if $show eq 'event-payment'}
{literal}
- <script type='text/javascript'>
- var dataUrl = {/literal}'{crmURL p="civicrm/payment/view" h=0 q="action=browse&id=$participantId&cid=`$contactId`&component=event&context=payment_info&snippet=4"}'{literal};
- cj.ajax({
- url: dataUrl,
- async: false,
- success: function(html) {
- cj("#payment-info").html(html);
- }
- });
- </script>
+<script type='text/javascript'>
+cj(function($){
+ var dataUrl = {/literal}'{crmURL p="civicrm/payment/view" h=0 q="action=browse&id=$participantId&cid=`$contactId`&component=event&context=payment_info&snippet=4"}'{literal};
+ cj.ajax({
+ url: dataUrl,
+ async: false,
+ success: function(html) {
+ cj("#payment-info").html(html);
+ }
+ });
+
+ cj('.total_amount-section').remove();
+});
+</script>
{/literal}
{/if}
{if $context eq 'payment_info'}
+--------------------------------------------------------------------+
*}
{* This template is used to change selections of fees for a participant *}
-
+{literal}
+<script type='text/javascript'>
+function display(totalfee) {
+ // totalfee is monetary, round it to 2 decimal points so it can
+ // go as a float - CRM-13491
+ totalfee = Math.round(totalfee*100)/100;
+ // note : some variables used used here are global variables defined inside Calculate.tpl
+ var totalEventFee = formatMoney( totalfee, 2, seperator, thousandMarker);
+ document.getElementById('pricevalue').innerHTML = "<b>"+symbol+"</b> "+totalEventFee;
+ scriptfee = totalfee;
+ scriptarray = price;
+ cj('#total_amount').val( totalfee );
+ ( totalfee < 0 ) ? cj('table#pricelabel').addClass('disabled') : cj('table#pricelabel').removeClass('disabled');
+
+ // populate the balance amount div
+ populatebalanceFee();
+}
+
+function populatebalanceFee() {
+ // calculate the balance amount using total paid and updated amount
+ var updatedFeeUnFormatted = cj('#pricevalue').text();
+ var updatedAmt = parseFloat(updatedFeeUnFormatted.replace(/[^0-9-.]/g, ''));
+ var balanceAmt = updatedAmt - CRM.feePaid;
+ balanceAmt = formatMoney(balanceAmt, 2, seperator, thousandMarker);
+ cj('#balance-fee').text(symbol+" "+balanceAmt);
+}
+
+{/literal}
+</script>
<h3>Change Registration Selections</h3>
<div class="crm-block crm-form-block crm-payment-form-block">
<table class='form-layout'>
<tr class="crm-event-eventfees-form-block-price_set_amount">
<td class="label" style="padding-top: 10px;">{$form.amount.label}</td>
- <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}</table></td>
- </tr>
+ <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" dontInclCal="true"}</table></td>
+ </tr>
{if $paymentInfo}
<tr><td></td><td>
<div class='crm-section'>
</div>
<div class='label'><strong>{ts}Balance Owed{/ts}</strong></div><div id='balance-fee' class='content'></div>
</div>
- {include file='CRM/Price/Form/Calculate.tpl' currencySymbol=$currencySymbol noCalcValueDisplay='false'}
+ {include file='CRM/Price/Form/Calculate.tpl' currencySymbol=$currencySymbol noCalcValueDisplay='false' displayOveride='true'}
{/if}
</table>
</fieldset>
</div>
{literal}
<script type='text/javascript'>
-cj(function(){
+cj(function($){
cj('.total_amount-section').remove();
- cj('#pricevalue').val().trigger('populatebalanceFee');
-
- function populatebalanceFee() {
- console.log('dd');
- // calculate the balance amount using total paid and updated amount
- var updatedFeeUnFormatted = cj('#pricevalue').val();
- var updatedAmt = parseFloat(updatedFeeUnFormatted.replace(/[^0-9-.]/g, ''));
- var balanceAmt = updatedAmt - CRM.feePaid;
- balanceAmt = formatMoney(balanceAmt, 2, seperator, thousandMarker);
- cj('#balance-fee').val(balanceAmt);
- }
});
</script>
{/literal}
\ No newline at end of file
{if $fee_level}
<tr class="crm-event-participantview-form-block-fee_amount">
{if $lineItem}
- <td class="label">{ts}Event Fees{/ts}</td>
- <td>{include file="CRM/Price/Page/LineItem.tpl" context="Event"}</td>
+ <td class="label">{ts}Selections{/ts}</td>
+ <td>{include file="CRM/Price/Page/LineItem.tpl" context="Event"}
+ <a class="button" href='{crmURL p="civicrm/event/participant/feeselection" q="reset=1&id=`$participantId`&cid=`$contactId`&action=update"}' title="{ts}Change Selections{/ts}"><span><div class="icon edit-icon"></div> {ts}Change Selections{/ts}</span></a>
+ </td>
{else}
<td class="label">{ts}Event Level{/ts}</td>
<td>{$fee_level} {if $fee_amount}- {$fee_amount|crmMoney:$fee_currency}{/if}</td>
<div class="content {$element.name}-content">{$form.$element_name.html}
{if $element.is_display_amounts && $element.html_type eq 'Text'}
<span class="price-field-amount">
- x {foreach item=option from=$element.options}{$option.amount|crmMoney}{/foreach}
+ {foreach item=option from=$element.options}{$option.amount|crmMoney}{/foreach}
</span>
{/if}
{if $element.help_post}<br /><span class="description">{$element.help_post}</span>{/if}
{/if}
{* Include the total calculation widget if this is NOT a quickconfig event/contribution page. *}
-{if !$quickConfig}
+{if !$quickConfig and !$dontInclCal}
{include file="CRM/Price/Form/Calculate.tpl"}
{/if}
-
-</div>
+</div>
\ No newline at end of file