From a8b59c2cea7ae0ed92f1e89685501b9f0ebc1399 Mon Sep 17 00:00:00 2001 From: Edsel Date: Tue, 21 Jul 2015 16:06:55 +0530 Subject: [PATCH] ICM-18 Fixed warnings reported by Jenkins --- CRM/Event/Form/Registration.php | 4 ++-- CRM/Financial/BAO/FinancialType.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 7716fed2b1..ce05f73807 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -243,7 +243,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { // check for is_monetary status $isMonetary = CRM_Utils_Array::value('is_monetary', $this->_values['event']); // check for ability to add contributions of type - if ($isMonetary + if ($isMonetary && CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && !CRM_Core_Permission::check('add contributions of type ' . CRM_Contribute_PseudoConstant::financialType($this->_values['event']['financial_type_id'])) ) { @@ -683,7 +683,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { else { $isPaidEvent = CRM_Utils_Array::value('is_monetary', $form->_values['event']); } - if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() + if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && !empty($form->_values['fee']) ) { foreach ($form->_values['fee'] as $k => $fees) { diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index 2e9eb99447..b9dc236022 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -196,7 +196,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { && !CRM_Core_Permission::check('add contributions of type ' . $financialTypeName)) ) { unset($financialType[$key]); - } + } } return $financialType; } @@ -286,7 +286,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { $whereClauses[] = ' ' . $alias . '.financial_type_id IN (0)'; } else { - $whereClauses[] = ' ' . $alias . '.financial_type_id IN (' . implode(',' , array_keys($types)) .')'; + $whereClauses[] = ' ' . $alias . '.financial_type_id IN (' . implode(',', array_keys($types)) . ')'; } } else { @@ -302,7 +302,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { $whereClauses .= " AND civicrm_{$component}.{$column} IN (0)"; return; } - $whereClauses .= " AND civicrm_{$component}.{$column} IN (" . implode(',', array_keys($types)) .")"; + $whereClauses .= " AND civicrm_{$component}.{$column} IN (" . implode(',', array_keys($types)) . ")"; } } @@ -345,4 +345,5 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { } return self::$_statusACLFt['acl_financial_type']; } + } -- 2.25.1