return TRUE;
}
+ /**
+ * @param $showAll
+ * @param $profileType
+ * @param $contactActivityProfile
+ *
+ * @return array
+ */
protected static function getImportableFields($showAll, $profileType, $contactActivityProfile) {
if (!$showAll) {
$importableFields = CRM_Contact_BAO_Contact::importableFields('All', FALSE, FALSE, FALSE, TRUE, TRUE);
return $locationFields;
}
+ /**
+ * @param $ctype
+ *
+ * @return mixed
+ */
protected static function getCustomFields($ctype) {
static $customFieldCache = array();
if (!isset($customFieldCache[$ctype])) {
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$multipleFields = array('url');
- $nullIndex = $nullValueIndex = ' ';
//start of code to set the default values
foreach ($fields as $name => $field) {
continue;
}
+ // Create a unique, non-empty index for each field.
$index = $field['title'];
- //handle for the label not set for the field
- if (empty($field['title'])) {
- $index = $nullIndex;
- $nullIndex .= $nullIndex;
- }
+ if ($index === '') $index = ' ';
+ while (array_key_exists($index, $values))
+ $index .= ' ';
- //handle the case to avoid re-write where the profile field labels are the same
- if (array_key_exists($index, $values)) {
- $index .= $nullValueIndex;
- $nullValueIndex .= $nullValueIndex;
- }
$params[$index] = $values[$index] = '';
$customFieldName = NULL;
// hack for CRM-665
}
}
elseif ($name == 'image_URL') {
- list($width, $height) = getimagesize($details->$name);
+ list($width, $height) = getimagesize(CRM_Utils_String::unstupifyUrl($details->$name));
list($thumbWidth, $thumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($width, $height);
$image_URL = '<img src="' . $details->$name . '" height= ' . $thumbHeight . ' width= ' . $thumbWidth . ' />';
elseif (substr($fieldName, 0, 6) === 'county') {
if ($addressOptions['county']) {
$form->add('select', $name, $title,
- array(
- '' => ts('(choose state first)')), $required
+ array('' => ts('Choose state first')), $required
);
}
}
}
}
}
+ elseif ($name == 'contact_sub_type') {
+ $defaults[$fldName] = explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($details[$name], CRM_Core_DAO::VALUE_SEPARATOR));
+ }
elseif ($name == 'world_region') {
$defaults[$fldName] = $details['worldregion_id'];
}
}
/**
- * Funtion to determine of we show overlay profile or not
+ * Function to determine of we show overlay profile or not
*
* @return boolean true if profile should be shown else false
* @static
return $groupTypeValue;
}
+ /**
+ * @return bool|object
+ */
static function isProfileDoubleOptin() {
// check for double optin
$config = CRM_Core_Config::singleton();
return FALSE;
}
+ /**
+ * @return bool|object
+ */
static function isProfileAddToGroupDoubleOptin() {
// check for add to group double optin
$config = CRM_Core_Config::singleton();