function __construct(&$formValues) {
$this->_formValues = $formValues;
$this->_columns = array(
- ts('Contact Id') => 'contact_id',
+ ts('Contact ID') => 'contact_id',
ts('Contact Type') => 'contact_type',
ts('Name') => 'sort_name',
ts('Group Name') => 'gname',
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
$this->setTitle(ts('Include / Exclude Search'));
- $groups = CRM_Core_PseudoConstant::group();
+ $groups = CRM_Core_PseudoConstant::nestedGroup();
$tags = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', array('onlyActive' => FALSE));
if (count($groups) == 0 || count($tags) == 0) {
CRM_Utils_System::redirect($url);
}
- $inG = &$form->addElement('advmultiselect', 'includeGroups',
- ts('Include Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $select2style = array(
+ 'multiple' => TRUE,
+ 'style' => 'width: 100%; max-width: 60em;',
+ 'class' => 'crm-select2',
+ 'placeholder' => ts('- select -'),
);
- $outG = &$form->addElement('advmultiselect', 'excludeGroups',
- ts('Exclude Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'includeGroups',
+ ts('Include Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
+ );
+
+ $form->add('select', 'excludeGroups',
+ ts('Exclude Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
);
$andOr = array(
);
$form->addRadio('andOr', ts('AND/OR'), $andOr, NULL, '<br />', TRUE);
- $int = &$form->addElement('advmultiselect', 'includeTags',
- ts('Include Tag(s)') . ' ', $tags,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'includeTags',
+ ts('Include Tag(s)'),
+ $tags,
+ FALSE,
+ $select2style
);
- $outt = &$form->addElement('advmultiselect', 'excludeTags',
- ts('Exclude Tag(s)') . ' ', $tags,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'excludeTags',
+ ts('Exclude Tag(s)'),
+ $tags,
+ FALSE,
+ $select2style
);
- //add/remove buttons for groups
- $inG->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $outG->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
- $outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
-
- //add/remove buttons for tags
- $int->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $outt->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $int->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
- $outt->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
-
/**
* if you are using the standard template, this array tells the template what elements
* are part of the search criteria
$defaults['includeGroups'] = CRM_Utils_Array::value('includeGroups', $this->_formValues);
$defaults['excludeGroups'] = CRM_Utils_Array::value('excludeGroups', $this->_formValues);
+
+ $defaults['includeTags'] = CRM_Utils_Array::value('includeTags', $this->_formValues);
+ $defaults['excludeTags'] = CRM_Utils_Array::value('excludeTags', $this->_formValues);
}
return $defaults;