From 70af95e4cd0cadb62fb3dbccc7fadb4f07b6d18f Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 5 Nov 2015 23:52:02 -0800 Subject: [PATCH] CRM-16929 price set calcs Consolidate calculation to a single function, always store calculated total on the form (even if not visible) for consistent calcs. This means the 'raw-data' attribute is calculated regardless of whether we are working with a 'price set' or a 'quick config' priceset and can always be used for calculating whether to show it --- .../Event/Form/ParticipantFeeSelection.tpl | 4 ++-- templates/CRM/Price/Form/Calculate.tpl | 22 ++++++++++++------- templates/CRM/Price/Form/PriceSet.tpl | 3 --- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/templates/CRM/Event/Form/ParticipantFeeSelection.tpl b/templates/CRM/Event/Form/ParticipantFeeSelection.tpl index b9c42612b0..608d496c72 100644 --- a/templates/CRM/Event/Form/ParticipantFeeSelection.tpl +++ b/templates/CRM/Event/Form/ParticipantFeeSelection.tpl @@ -130,7 +130,7 @@ CRM.$(function($) { - + {if $paymentInfo}
{$form.amount.label}{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" dontInclCal="true" context="participant"}
{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" noCalcValueDisplay=0 context="participant"}
@@ -143,7 +143,7 @@ CRM.$(function($) {
{ts}Balance Owed{/ts}
- {include file='CRM/Price/Form/Calculate.tpl' currencySymbol=$currencySymbol noCalcValueDisplay='false' displayOveride='true'} + {include file='CRM/Price/Form/Calculate.tpl' currencySymbol=$currencySymbol noCalcValueDisplay=1 displayOveride='true'} {/if}
diff --git a/templates/CRM/Price/Form/Calculate.tpl b/templates/CRM/Price/Form/Calculate.tpl index 1227b798ce..f460ee7864 100644 --- a/templates/CRM/Price/Form/Calculate.tpl +++ b/templates/CRM/Price/Form/Calculate.tpl @@ -23,16 +23,22 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if $noCalcValueDisplay neq 'false'} + +{assign var='hideTotal' value=$quickConfig+$noCalcValueDisplay}
-
-
+ {if !$hideTotal} +
+ +
+ {/if} +
-{/if} +