$htmlType = array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select',
'Select',
'Radio',
'Multi-Select State/Province',
}
// check for values for custom fields for checkboxes and multiselect
- if ($customFields[$customFieldID]['html_type'] == 'CheckBox' || $customFields[$customFieldID]['html_type'] == 'AdvMulti-Select' || $customFields[$customFieldID]['html_type'] == 'Multi-Select') {
+ if ($customFields[$customFieldID]['html_type'] == 'CheckBox' || $customFields[$customFieldID]['html_type'] == 'Multi-Select') {
$value = trim($value);
$value = str_replace('|', ',', $value);
$mulValues = explode(',', $value);
'Radio' => 'Radio',
'CheckBox' => 'CheckBox',
'Multi-Select' => 'Multi-Select',
- 'AdvMulti-Select' => 'AdvMulti-Select',
'Autocomplete-Select' => 'Autocomplete-Select',
),
array('Text' => 'Text', 'Select' => 'Select', 'Radio' => 'Radio'),
break;
case 'CheckBox':
- case 'AdvMulti-Select':
case 'Multi-Select':
if (isset($params['default_checkbox_option'])) {
$tempArray = array_keys($params['default_checkbox_option']);
'Multi-Select State/Province',
'Select Country',
'Multi-Select Country',
- 'AdvMulti-Select',
'CheckBox',
'Radio',
)));
$options = $field->getOptions($search ? 'search' : 'create');
// Consolidate widget types to simplify the below switch statement
- if ($search || ($widget !== 'AdvMulti-Select' && strpos($widget, 'Select') !== FALSE)) {
+ if ($search || (strpos($widget, 'Select') !== FALSE)) {
$widget = 'Select';
}
}
break;
- case 'AdvMulti-Select':
- $element = $qf->addElement(
- 'advmultiselect',
- $elementName,
- $label, $options,
- array(
- 'size' => 5,
- 'style' => '',
- 'class' => 'advmultiselect',
- 'data-crm-custom' => $dataCrmCustomVal,
- )
- );
-
- $element->setButtonAttributes('add', array('value' => ts('Add >>')));
- $element->setButtonAttributes('remove', array('value' => ts('<< Remove')));
-
- if ($useRequired && !$search) {
- $qf->addRule($elementName, ts('%1 is a required field.', array(1 => $label)), 'required');
- }
- break;
-
case 'CheckBox':
$check = array();
foreach ($options as $v => $l) {
case 'Select Country':
case 'Select State/Province':
case 'CheckBox':
- case 'AdvMulti-Select':
case 'Multi-Select':
case 'Multi-Select State/Province':
case 'Multi-Select Country':
}
switch ($customField->html_type) {
case 'CheckBox':
- case 'AdvMulti-Select':
case 'Multi-Select':
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldId, FALSE);
$defaults[$elementName] = array();
if ($customField->html_type == 'CheckBox') {
$defaults[$elementName][$val['value']] = 1;
}
- elseif ($customField->html_type == 'Multi-Select' ||
- $customField->html_type == 'AdvMulti-Select'
- ) {
+ elseif ($customField->html_type == 'Multi-Select') {
$defaults[$elementName][$val['value']] = $val['value'];
}
}
}
}
- if ($customFields[$customFieldId]['html_type'] == 'Multi-Select' ||
- $customFields[$customFieldId]['html_type'] == 'AdvMulti-Select'
- ) {
+ if ($customFields[$customFieldId]['html_type'] == 'Multi-Select') {
if ($value) {
$value = CRM_Utils_Array::implodePadded($value);
}
}
if (($customFields[$customFieldId]['html_type'] == 'Multi-Select' ||
- $customFields[$customFieldId]['html_type'] == 'AdvMulti-Select' ||
$customFields[$customFieldId]['html_type'] == 'CheckBox'
) &&
$customFields[$customFieldId]['data_type'] == 'String' &&
switch ($field['html_type']) {
case 'Multi-Select':
- case 'AdvMulti-Select':
case 'CheckBox':
$defaults[$elementName] = array();
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($field['id'], $inactiveNeeded);
//added Multi-Select option in the below if-statement
if ($field['html_type'] == 'CheckBox' ||
$field['html_type'] == 'Radio' ||
- $field['html_type'] == 'AdvMulti-Select' ||
$field['html_type'] == 'Multi-Select'
) {
$groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = 'NULL';
}
break;
- //added for Advanced Multi-Select
-
- case 'AdvMulti-Select':
- //added for Multi-Select
case 'Multi-Select':
if (!empty($v)) {
$groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR
$htmlType = array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select',
'Select',
'Radio',
);
$valid = CRM_Core_BAO_CustomValue::typecheck($field['data_type'], $value);
}
if ($field['html_type'] == 'CheckBox' ||
- $field['html_type'] == 'AdvMulti-Select' ||
$field['html_type'] == 'Multi-Select'
) {
$value = str_replace("|", ",", $value);
$action -= CRM_Core_Action::DELETE;
}
- if (in_array($field->html_type, array('CheckBox', 'AdvMulti-Select', 'Multi-Select'))) {
+ if (in_array($field->html_type, ['CheckBox', 'Multi-Select'])) {
if (isset($defVal) && in_array($dao->value, $defVal)) {
$options[$dao->id]['is_default'] = '<img src="' . $config->resourceBase . 'i/check.gif" />';
}
);
break;
- case 'AdvMulti-Select':
case 'Multi-Select':
case 'CheckBox':
$oldString = CRM_Core_DAO::VALUE_SEPARATOR . $oldValue . CRM_Core_DAO::VALUE_SEPARATOR;
elseif (in_array($htmlType, array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select',
'Multi-Select State/Province',
'Multi-Select Country',
))) {
switch ($customFields[$customFieldId]['html_type']) {
case 'Multi-Select State/Province':
case 'Multi-Select Country':
- case 'AdvMulti-Select':
case 'Multi-Select':
$v = explode(CRM_Core_DAO::VALUE_SEPARATOR, $details[$name]);
foreach ($v as $item) {
$elements["onbehalf_{$key}"]['value'][$k] = $v;
}
}
- elseif (strstr($htmlType, 'Multi-Select') && $htmlType != 'AdvMulti-Select') {
+ elseif (strstr($htmlType, 'Multi-Select')) {
$elements["onbehalf_{$key}"]['type'] = 'Multi-Select';
$elements["onbehalf_{$key}"]['value'] = array_values($defaults[$key]);
}
'RichTextEditor' => ts('Rich Text Editor'),
'Autocomplete-Select' => ts('Autocomplete-Select'),
'Multi-Select' => ts('Multi-Select'),
- 'AdvMulti-Select' => ts('AdvMulti-Select'),
'Link' => ts('Link'),
'ContactReference' => ts('Autocomplete-Select'),
);
$mutliValueOps = array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select',
);
$srcHtmlType = $this->_values['html_type'];
$mutliValueOps = array(
'CheckBox' => 'CheckBox',
'Multi-Select' => 'Multi-Select',
- 'AdvMulti-Select' => 'AdvMulti-Select',
);
switch ($dataType) {
'Radio' => ts('Radio'),
'CheckBox' => ts('CheckBox'),
'Multi-Select' => ts('Multi-Select'),
- 'AdvMulti-Select' => ts('Adv Multi-Select (obsolete)'),
'Autocomplete-Select' => ts('Autocomplete-Select'),
),
array(
if (isset($fields['data_type'][1])) {
$dataField = $fields['data_type'][1];
}
- $optionFields = array('Select', 'Multi-Select', 'CheckBox', 'Radio', 'AdvMulti-Select');
+ $optionFields = array('Select', 'Multi-Select', 'CheckBox', 'Radio');
if (isset($fields['option_type']) && $fields['option_type'] == 1) {
//capture duplicate Custom option values
if ($fieldDefaults['html_type'] == 'CheckBox'
|| $fieldDefaults['html_type'] == 'Multi-Select'
- || $fieldDefaults['html_type'] == 'AdvMulti-Select'
) {
if (!empty($fieldDefaults['default_value'])) {
$defaultCheckValues = explode(CRM_Core_DAO::VALUE_SEPARATOR,
$customField->find(TRUE) &&
(
$customField->html_type == 'CheckBox' ||
- $customField->html_type == 'AdvMulti-Select' ||
$customField->html_type == 'Multi-Select'
)
) {
break;
case 'CheckBox':
- case 'AdvMulti-Select':
case 'Multi-Select':
case 'Multi-Select Country':
case 'Multi-Select State/Province':
if (in_array($htmlType, array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select',
))) {
$submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
$mergeValue
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) {
$values[$key] = $value;
$type = $customFields[$customFieldID]['html_type'];
- if ($type == 'CheckBox' || $type == 'Multi-Select' || $type == 'AdvMulti-Select') {
+ if ($type == 'CheckBox' || $type == 'Multi-Select') {
$mulValues = explode(',', $value);
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE);
$values[$key] = array();
SET @UKCountryId = (SELECT id FROM civicrm_country cc WHERE cc.name = 'United Kingdom');
INSERT INTO civicrm_state_province (country_id, abbreviation, name)
VALUES (@UKCountryId, 'MON', 'Monmouthshire');
+
+{* dev/core/#152 *}
+UPDATE `civicrm_custom_field` set `html_type` = "Multi-Select" WHERE `html_type` = "AdvMulti-Select";
$htmlType = CRM_Utils_Array::value('html_type', $customFields[$customFieldID]);
switch ($htmlType) {
case 'CheckBox':
- case 'AdvMulti-Select':
case 'Multi-Select':
if ($val) {
$mulValues = explode(',', $val);
}
if (in_array($htmlType, array(
- 'Select', 'Multi-Select', 'CheckBox', 'Radio', 'AdvMulti-Select')) &&
+ 'Select', 'Multi-Select', 'CheckBox', 'Radio')) &&
!isset($errors[$fieldName])
) {
$options = CRM_Core_OptionGroup::valuesByID($fieldDetails['option_group_id']);
function checkCustomDataField( ) {
var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
var singleValOps = ['Text', 'Select', 'Radio', 'Autocomplete-Select'];
- var multiValOps = ['CheckBox', 'Multi-Select', 'AdvMulti-Select'];
+ var multiValOps = ['CheckBox', 'Multi-Select'];
var dstHtmlType = cj('#dst_html_type').val( );
if ( !dstHtmlType ) {
return true;
<script type="text/javascript">
CRM.$(function($) {
var $form = $('form.{/literal}{$form.formClass}{literal}'),
- deprecatedNotice,
dataTypes = {/literal}{$dataTypeKeys|@json_encode}{literal};
- function deprecatedWidgets() {
- deprecatedNotice && deprecatedNotice.close && deprecatedNotice.close();
- switch ($('#data_type_1', $form).val()) {
- case 'AdvMulti-Select':
- deprecatedNotice = CRM.alert({/literal}'{ts escape="js"}The old "Advance Multi-Select" widget is being phased out and will be removed in a future version of CiviCRM. "Multi-Select" is the recommended substitute.{/ts}', '{ts escape="js"}Obsolete widget{/ts}'{literal}, 'alert', {expires: 0});
- break;
- }
- }
- $('#data_type_1', $form).each(deprecatedWidgets).change(deprecatedWidgets);
-
function showSearchRange() {
var htmlType = $("[name='data_type[1]']", $form).val(),
dataType = dataTypes[$("[name='data_type[0]']", $form).val()];
$customField6 = 'Customfield_alp_multiselect' . substr(sha1(rand()), 0, 4);
$customFieldId6 = $this->_createMultipleValueCustomField($customField6, 'Multi-Select');
- // create custom field - "alphanumeric advmultiselect"
- $this->click("newCustomField");
- $this->waitForElementPresent('_qf_Field_done-bottom');
- $customField7 = 'Customfield_alp_advmultiselect' . substr(sha1(rand()), 0, 4);
- $customFieldId7 = $this->_createMultipleValueCustomField($customField7, 'AdvMulti-Select');
-
// create custom field - "alphanumeric autocompleteselect"
$this->click("newCustomField");
$this->waitForElementPresent('_qf_Field_done-bottom');
"custom_{$customFieldId4}" => "$customField4 :: $customGroupTitle",
"custom_{$customFieldId5}" => "$customField5 :: $customGroupTitle",
"custom_{$customFieldId6}" => "$customField6 :: $customGroupTitle",
- "custom_{$customFieldId7}" => "$customField7 :: $customGroupTitle",
"custom_{$customFieldId8}" => "$customField8 :: $customGroupTitle",
"custom_{$customFieldId1}" => "$customField1 :: $customGroupTitle",
"custom_{$customFieldId2}" => "$customField2 :: $customGroupTitle",
"custom_{$customFieldId4}" => "label1",
"custom_{$customFieldId5}" => "label1",
"custom_{$customFieldId6}" => "label1",
- "custom_{$customFieldId7}" => "label1",
"custom_{$customFieldId8}" => "label1",
"custom_{$customFieldId1}" => 1,
"custom_{$customFieldId2}" => 12345,
$customField4 => 'label1',
$customField5 => 'label1',
$customField6 => 'label1',
- $customField7 => 'label1',
$customField8 => 'label1',
$customField1 => '1',
$customField2 => '12345',
$customFieldDataType = CRM_Core_BAO_CustomField::dataType();
$dataToHtmlTypes = CRM_Core_BAO_CustomField::dataToHtml();
$count = 0;
- $optionSupportingHTMLTypes = array('Select', 'Radio', 'CheckBox', 'AdvMulti-Select', 'Autocomplete-Select', 'Multi-Select');
+ $optionSupportingHTMLTypes = array('Select', 'Radio', 'CheckBox', 'Autocomplete-Select', 'Multi-Select');
foreach ($customFieldDataType as $dataType => $label) {
switch ($dataType) {