From a17e67a12d0290d8be67cb003cb61bab70bcd435 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 15 Jul 2015 01:33:31 +0530 Subject: [PATCH] --ICM-15, added condition to ignore default is_quick_config price set for ACL-FT --- CRM/Price/BAO/PriceFieldValue.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CRM/Price/BAO/PriceFieldValue.php b/CRM/Price/BAO/PriceFieldValue.php index 7d73b90c73..1c39e1f53f 100644 --- a/CRM/Price/BAO/PriceFieldValue.php +++ b/CRM/Price/BAO/PriceFieldValue.php @@ -155,14 +155,19 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * */ public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { - CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes); - $addWhere = "financial_type_id IN (0)"; - if (!empty($financialTypes)) { - $addWhere = "financial_type_id IN (" . implode(',', array_keys($financialTypes)) . ")"; - } + $sql = "SELECT cs.id FROM civicrm_price_set cs INNER JOIN civicrm_price_field cp ON cp.price_set_id = cs.id + WHERE cs.name IN ('default_contribution_amount', 'default_membership_type_amount') AND cp.id = {$fieldId} "; + $setId = CRM_Core_DAO::singleValueQuery($sql); $fieldValueDAO = new CRM_Price_DAO_PriceFieldValue(); $fieldValueDAO->price_field_id = $fieldId; - $fieldValueDAO->whereAdd($addWhere); + if (!$setId) { + CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes); + $addWhere = "financial_type_id IN (0)"; + if (!empty($financialTypes)) { + $addWhere = "financial_type_id IN (" . implode(',', array_keys($financialTypes)) . ")"; + } + $fieldValueDAO->whereAdd($addWhere); + } $fieldValueDAO->orderBy($orderBy, 'label'); if ($isActive) { $fieldValueDAO->is_active = 1; -- 2.25.1