$defaults['default_value'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Country', $countryId);
}
- if ($defaults['data_type'] == 'ContactReference' && CRM_Utils_Array::value('filter', $defaults)) {
+ if ($defaults['data_type'] == 'ContactReference' && !empty($defaults['filter'])) {
$contactRefFilter = 'Advance';
if (strpos($defaults['filter'], 'action=lookup') !== FALSE &&
strpos($defaults['filter'], 'group=') !== FALSE
$defaults['filter_selected'] = $contactRefFilter;
}
- if (CRM_Utils_Array::value('data_type', $defaults)) {
+ if (!empty($defaults['data_type'])) {
$defaultDataType = array_search($defaults['data_type'],
self::$_dataTypeKeys
);
$defaults['is_view'] = 0;
}
- if (CRM_Utils_Array::value('html_type', $defaults)) {
+ if (!empty($defaults['html_type'])) {
$dontShowLink = substr($defaults['html_type'], -14) == 'State/Province' || substr($defaults['html_type'], -7) == 'Country' ? 1 : 0;
}
if (isset($dontShowLink)) {
$this->assign('dontShowLink', $dontShowLink);
}
+ if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple', 'id')) {
+ $defaults['in_selector'] = 1;
+ }
+
return $defaults;
}
' '
);
$sel->setOptions(array($dt, $it));
+
+ if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple')) {
+ $this->add('checkbox', 'in_selector', ts('Display in Table?'));
+ }
+
if ($this->_action == CRM_Core_Action::UPDATE) {
$this->freeze('data_type');
}
break;
case 'ContactReference':
- if ($fields['filter_selected'] == 'Advance' &&
- CRM_Utils_Array::value('filter', $fields)
- ) {
+ if ($fields['filter_selected'] == 'Advance' && !empty($fields['filter'])) {
if (strpos($fields['filter'], 'entity=') !== FALSE) {
$errors['filter'] = ts("Please do not include entity parameter (entity is always 'contact')");
}
}
// we can not set require and view at the same time.
- if (CRM_Utils_Array::value('is_required', $fields) &&
- CRM_Utils_Array::value('is_view', $fields)
- ) {
+ if (!empty($fields['is_required']) && !empty($fields['is_view'])) {
$errors['is_view'] = ts('Can not set this field Required and View Only at the same time.');
}
//fix for 'is_search_range' field.
if (in_array($dataTypeKey, array(
1, 2, 3, 5))) {
- if (!CRM_Utils_Array::value('is_searchable', $params)) {
+ if (empty($params['is_searchable'])) {
$params['is_search_range'] = 0;
}
}
}
$filter = 'null';
- if ($dataTypeKey == 11 && CRM_Utils_Array::value('filter_selected', $params)) {
+ if ($dataTypeKey == 11 && !empty($params['filter_selected'])) {
if ($params['filter_selected'] == 'Advance' && trim(CRM_Utils_Array::value('filter', $params))) {
$filter = trim($params['filter']);
}
- elseif ($params['filter_selected'] == 'Group' && CRM_Utils_Array::value('group_id', $params)) {
+ elseif ($params['filter_selected'] == 'Group' && !empty($params['group_id'])) {
$filter = 'action=lookup&group=' . implode(',', $params['group_id']);
}