From 421dfaa6382ef8beda7ac9483b36a4ae540aa73c Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 3 Jun 2013 15:06:46 +1200 Subject: [PATCH] preliminary whitespace cleanup --- CRM/Price/BAO/LineItem.php | 28 ++++++++++++++-------------- CRM/Price/BAO/Set.php | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index aefa9abb0c..bf12278992 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -58,7 +58,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { //create mode only as we don't support editing line items CRM_Utils_Hook::pre('create', 'LineItem', $params['entity_id'], $params); - + $lineItemBAO = new CRM_Price_BAO_LineItem(); $lineItemBAO->copyValues($params); @@ -226,10 +226,10 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { 'auto_renew' => CRM_Utils_Array::value('auto_renew', $options[$oid]), 'html_type' => $fields['html_type'], 'financial_type_id' => CRM_Utils_Array::value( 'financial_type_id', $options[$oid]), - + ); if ($values[$oid]['membership_type_id'] && !isset($values[$oid]['auto_renew'])) { - $values[$oid]['auto_renew'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values[$oid]['membership_type_id'], 'auto_renew'); + $values[$oid]['auto_renew'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values[$oid]['membership_type_id'], 'auto_renew'); } } } @@ -243,7 +243,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { * @access public * @static */ - public static function deleteLineItems($entityId, $entityTable) { + public static function deleteLineItems($entityId, $entityTable) { if (!$entityId || !$entityTable) { return FALSE; } @@ -275,7 +275,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { ) { return; } - + foreach ($lineItem as $priceSetId => $values) { if (!$priceSetId) { continue; @@ -295,7 +295,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { } } } - } + } public static function syncLineItems($entityId, $entityTable = 'civicrm_contribution', $amount, $otherParams = NULL) { if (!$entityId || CRM_Utils_System::isNull($amount)) @@ -305,10 +305,10 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { LEFT JOIN civicrm_price_field pf ON pf.id = li.price_field_id LEFT JOIN civicrm_price_set ps ON ps.id = pf.price_set_id "; - $set = " li.unit_price = %3, + $set = " li.unit_price = %3, li.line_total = %3 "; - $where = " li.entity_id = %1 AND + $where = " li.entity_id = %1 AND li.entity_table = %2 "; $params = array( @@ -320,8 +320,8 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { if ($entityTable == 'civicrm_contribution') { $entityName = 'default_contribution_amount'; $where .= " AND ps.name = %4 "; - $params[4] = array($entityName, 'String'); - } + $params[4] = array($entityName, 'String'); + } elseif ($entityTable == 'civicrm_participant') { $from .= " LEFT JOIN civicrm_price_set_entity cpse ON cpse.price_set_id = ps.id @@ -336,10 +336,10 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { ); } - $query = " + $query = " UPDATE $from SET $set - WHERE $where + WHERE $where "; CRM_Core_DAO::executeQuery($query, $params); @@ -358,7 +358,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { * @static */ static function getLineItemArray(&$params, $entityId = NULL, $entityTable = 'contribution') { - + if (!$entityId) { $priceSetDetails = CRM_Price_BAO_Set::getDefaultPriceSet(); foreach ($priceSetDetails as $values) { @@ -372,7 +372,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { 'financial_type_id' => $params['financial_type_id'] ); } - } + } else { $setID = NULL; $totalEntityId = count($entityId); diff --git a/CRM/Price/BAO/Set.php b/CRM/Price/BAO/Set.php index e2c9e57279..0bc369ab51 100644 --- a/CRM/Price/BAO/Set.php +++ b/CRM/Price/BAO/Set.php @@ -1193,7 +1193,7 @@ WHERE ps.id = %1 if($isQuickConfig) { $copyPriceSet = &CRM_Price_BAO_Set::copy($priceSetId); CRM_Price_BAO_Set::addTo($baoName, $newId, $copyPriceSet->id); - } + } else { $copyPriceSet = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_SetEntity', array( @@ -1209,7 +1209,7 @@ WHERE ps.id = %1 foreach ($discount as $discountId => $setId) { $copyPriceSet = &CRM_Price_BAO_Set::copy($setId); - + $copyDiscount = &CRM_Core_DAO::copyGeneric( 'CRM_Core_DAO_Discount', array( -- 2.25.1