//get the campaign groups.
$groups = CRM_Core_PseudoConstant::group();
- $inG = &$this->addElement('advmultiselect', 'includeGroups',
- ts('Include Group(s)') . ' ',
+ $this->add('select', 'includeGroups',
+ ts('Include Group(s)'),
$groups,
+ FALSE,
array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
+ 'multiple' => TRUE,
+ 'class' => 'crm-select2 huge',
+ 'placeholder' => ts('- none -'),
)
);
- $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
- $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$this->addWysiwyg('goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40));
$this->add('text', 'goal_revenue', ts('Revenue Goal'), array('size' => 8, 'maxlength' => 12));
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
$form->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'custom'));
$form->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'custom'));
$groups = CRM_Core_PseudoConstant::group();
- $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
);
- $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')));
+ $form->add('select', 'excludeGroups',
+ ts('Exclude Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
+ );
$this->setTitle('Search by date added to CiviCRM');
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
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
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
$form->add('text',
);
$groups = CRM_Core_PseudoConstant::group();
- $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
);
- $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')));
+ $form->add('select', 'excludeGroups',
+ ts('Exclude Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
+ );
$this->setTitle('Create a random segment of contacts');