$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;
}
$this->assign('paymentProcessor', $paymentProcessor);
- $this->addCheckBox('payment_processor', ts('Payment Processor'),
- array_flip($paymentProcessor),
- NULL, NULL, NULL, NULL,
- array(' ', ' ', ' ', '<br/>')
- );
+ $this->addEntityRef('payment_processor', ts('Payment Processor'), array(
+ 'entity' => 'PaymentProcessor',
+ 'multiple' => TRUE,
+ 'select' => array('minimumInputLength' => 0),
+ ));
// financial type
$this->addSelect('financial_type_id');
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';