From 66094995512afa0a8c37f0a0b5304ce394ec6bb1 Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 7 Aug 2013 23:11:44 +0530 Subject: [PATCH] fixes to setdefaults, CRM-12970 ---------------------------------------- * CRM-12970: civicrm_price_field_value not removed for discount price set http://issues.civicrm.org/jira/browse/CRM-12970 --- CRM/Event/Form/ManageEvent/Fee.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 071869cf81..f82e835d80 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -147,14 +147,16 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { $discountFields = current($val); $discountFields = current($discountFields['fields']); + $colCount = 1; foreach ($discountFields['options'] as $discountFieldsval) { - $defaults['discounted_label'][$discountFieldsval['weight']] = $discountFieldsval['label']; - $defaults['discounted_value'][$discountFieldsval['weight']][$rowCount] = + $defaults['discounted_label'][$colCount] = $discountFieldsval['label']; + $defaults['discounted_value'][$colCount][$rowCount] = CRM_Utils_Money::format($discountFieldsval['amount'], NULL, '%a'); - $defaults['discount_option_id'][$rowCount][$discountFieldsval['weight']]= $discountFieldsval['id']; + $defaults['discount_option_id'][$colCount][$rowCount]= $discountFieldsval['id']; if (CRM_Utils_Array::value('is_default', $discountFieldsval)) { $defaults['discounted_default'] = $discountFieldsval['weight']; } + $colCount++; } $rowCount++; } @@ -542,7 +544,6 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { * @access public */ public function postProcess() { - $params = array(); $eventTitle = ''; $params = $this->exportValues(); -- 2.25.1