From: Pradeep Nayak Date: Sun, 15 Sep 2013 12:17:54 +0000 (+0530) Subject: Revert "fixes to setdefaults, CRM-12970" X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=96fb2c1c651479d992e71d66486b5a4fc19524f0;p=civicrm-core.git Revert "fixes to setdefaults, CRM-12970" This reverts commit 66094995512afa0a8c37f0a0b5304ce394ec6bb1. --- diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index d5f56a6af1..eade71ead3 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -147,16 +147,14 @@ 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'][$colCount] = $discountFieldsval['label']; - $defaults['discounted_value'][$colCount][$rowCount] = + $defaults['discounted_label'][$discountFieldsval['weight']] = $discountFieldsval['label']; + $defaults['discounted_value'][$discountFieldsval['weight']][$rowCount] = CRM_Utils_Money::format($discountFieldsval['amount'], NULL, '%a'); - $defaults['discount_option_id'][$colCount][$rowCount]= $discountFieldsval['id']; + $defaults['discount_option_id'][$rowCount][$discountFieldsval['weight']]= $discountFieldsval['id']; if (CRM_Utils_Array::value('is_default', $discountFieldsval)) { $defaults['discounted_default'] = $discountFieldsval['weight']; } - $colCount++; } $rowCount++; } @@ -544,6 +542,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { * @access public */ public function postProcess() { + $params = array(); $eventTitle = ''; $params = $this->exportValues();