* @param CRM_Core_Form $form
*/
public static function buildSearchForm(&$form) {
- $membershipStatus = CRM_Member_PseudoConstant::membershipStatus();
+ $membershipStatus = CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label', FALSE, FALSE);
- $form->add('select', 'membership_status_id', ts('Membership Status(s)'), $membershipStatus, FALSE,
- array('id' => 'membership_status_id', 'multiple' => 'multiple', 'class' => 'crm-select2')
- );
-
- $form->addSelect('membership_type_id',
- array('entity' => 'membership', 'multiple' => 'multiple', 'label' => ts('Membership Type(s)'), 'option_url' => NULL, 'placeholder' => ts('- any -'))
- );
+ $form->add('select', 'membership_status_id', ts('Membership Status(s)'), $membershipStatus, FALSE, array(
+ 'id' => 'membership_status_id',
+ 'multiple' => 'multiple',
+ 'class' => 'crm-select2',
+ ));
+
+ $form->addEntityRef('membership_type_id', ts('Membership Type(s)'), array(
+ 'entity' => 'MembershipType',
+ 'multiple' => TRUE,
+ 'placeholder' => ts('- any -'),
+ 'select' => array('minimumInputLength' => 0),
+ ));
$form->addElement('text', 'member_source', ts('Source'));