From 202df40813cbbd563605e0f48d96eaf33cb29b7a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 2 May 2014 15:29:54 -0700 Subject: [PATCH] code cleanup --- CRM/Contribute/Form/Contribution/OnBehalfOf.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/OnBehalfOf.php b/CRM/Contribute/Form/Contribution/OnBehalfOf.php index 7140aada4b..38bd4653e6 100644 --- a/CRM/Contribute/Form/Contribution/OnBehalfOf.php +++ b/CRM/Contribute/Form/Contribution/OnBehalfOf.php @@ -130,13 +130,11 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf { if ($contactID && count($form->_employers) >= 1) { $form->add('text', 'organization_id', ts('Select an existing related Organization OR enter a new one')); - $employers = array(); - foreach ($form->_employers as $id => $vals) { - $employers[$id] = $vals['name']; - } - $form->add('select', 'onbehalfof_id', 'onbehalfof_id', $employers); - $orgOptions = array(0 => ts('Select an existing organization'), + $form->add('select', 'onbehalfof_id', '', CRM_Utils_Array::collect('name', $form->_employers)); + + $orgOptions = array( + 0 => ts('Select an existing organization'), 1 => ts('Enter a new organization'), ); -- 2.25.1