From 9f573c51b7b62661a7eeb38145b5934c45f582de Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 6 May 2015 17:22:47 -0400 Subject: [PATCH] CRM-16204 - Use EntityRef for configure event payment processors --- CRM/Event/Form/ManageEvent/Fee.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 50ae47e8c3..ed7cb9178d 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -238,9 +238,9 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { $this->assign('inDate', $this->_inDate); if (!empty($defaults['payment_processor'])) { - $defaults['payment_processor'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR, + $defaults['payment_processor'] = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', $defaults['payment_processor'] - ), '1'); + ); } return $defaults; } @@ -266,11 +266,11 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { $this->assign('paymentProcessor', $paymentProcessor); - $this->addCheckBox('payment_processor', ts('Payment Processor'), - array_flip($paymentProcessor), - NULL, NULL, NULL, NULL, - array('  ', '  ', '  ', '
') - ); + $this->addEntityRef('payment_processor', ts('Payment Processor'), array( + 'entity' => 'PaymentProcessor', + 'multiple' => TRUE, + 'select' => array('minimumInputLength' => 0), + )); // financial type $this->addSelect('financial_type_id'); @@ -565,10 +565,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { return; } - if (array_key_exists('payment_processor', $params) && - !CRM_Utils_System::isNull($params['payment_processor']) - ) { - $params['payment_processor'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, array_keys($params['payment_processor'])); + if (!empty($params['payment_processor'])) { + $params['payment_processor'] = str_replace(',', CRM_Core_DAO::VALUE_SEPARATOR, $params['payment_processor']); } else { $params['payment_processor'] = 'null'; -- 2.25.1