From: Monish Deb Date: Thu, 19 Oct 2017 10:31:42 +0000 (+0530) Subject: Merge pull request #11153 from yashodha/CRM-21327 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=408deba94f53616a3bb1027b744e3bec56ba87cc;hp=cdb0a39723328d15f589de0bd6f5bf0d99a9d645;p=civicrm-core.git Merge pull request #11153 from yashodha/CRM-21327 CRM-21327 - Not able to change Payment Processor in event fees --- diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index beaeb885bf..8b024d73e2 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -228,12 +228,12 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { } $this->_showHide->addToTemplate(); $this->assign('inDate', $this->_inDate); - if (!empty($defaults['payment_processor'])) { - $defaults['payment_processor'] = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', + $defaults['payment_processor'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR, $defaults['payment_processor'] - ); + ), '1'); } + return $defaults; } @@ -255,15 +255,11 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { $paymentProcessor = CRM_Core_PseudoConstant::paymentProcessor(); $this->assign('paymentProcessor', $paymentProcessor); - - $this->addEntityRef('payment_processor', ts('Payment Processor'), array( - 'entity' => 'PaymentProcessor', - 'multiple' => TRUE, - 'api' => array( - 'params' => array('domain_id' => CRM_Core_Config::domainID()), - ), - 'select' => array('minimumInputLength' => 0), - )); + $this->addCheckBox('payment_processor', ts('Payment Processor'), + array_flip($paymentProcessor), + NULL, NULL, NULL, NULL, + array('  ', '  ', '  ', '
') + ); // financial type if (!CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() || @@ -564,7 +560,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { } if (!empty($params['payment_processor'])) { - $params['payment_processor'] = str_replace(',', CRM_Core_DAO::VALUE_SEPARATOR, $params['payment_processor']); + $params['payment_processor'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, array_keys($params['payment_processor'])); } else { $params['payment_processor'] = 'null';