From 44c8822b3aa2e02680b9ffeca2e67b065b4f98c2 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Wed, 29 May 2013 10:30:32 -0700 Subject: [PATCH] fix notices and formatting fixes --- CRM/Price/BAO/Set.php | 10 ++++------ CRM/Price/Page/Field.php | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CRM/Price/BAO/Set.php b/CRM/Price/BAO/Set.php index e2c9e57279..e7434dc347 100644 --- a/CRM/Price/BAO/Set.php +++ b/CRM/Price/BAO/Set.php @@ -980,10 +980,8 @@ WHERE id = %1"; * * @param int $sid the price set id */ - function checkPermission($sid) { - if ($sid && - self::eventPriceSetDomainID() - ) { + static function checkPermission($sid) { + if ($sid && self::eventPriceSetDomainID()) { $domain_id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $sid, 'domain_id', 'id'); if (CRM_Core_Config::domainID() != $domain_id) { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); @@ -1193,7 +1191,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 +1207,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( diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index f52f8f26cf..4151ed7be7 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -131,7 +131,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { $priceFieldBAO->price_set_id = $this->_sid; $priceFieldBAO->orderBy('weight, label'); $priceFieldBAO->find(); - + while ($priceFieldBAO->fetch()) { $priceField[$priceFieldBAO->id] = array(); CRM_Core_DAO::storeValues($priceFieldBAO, $priceField[$priceFieldBAO->id]); @@ -145,7 +145,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { $priceField[$priceFieldBAO->id]['price'] = CRM_Utils_Array::value('amount', $optionValues); } - + $action = array_sum(array_keys($this->actionLinks())); if ($this->_isSetReserved) { @@ -243,7 +243,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { $this->assign('usedBy', $usedBy); $this->_isSetReserved= CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'is_reserved'); $this->assign('isReserved', $this->_isSetReserved); - + CRM_Price_BAO_Set::checkPermission($this->_sid); $comps = array( 'Event' => 'civicrm_event', -- 2.25.1