if ($this->_mode == self::MODE_EDIT) {
//specifies the action being done on a multi record field
$multiRecordAction = CRM_Utils_Request::retrieve('multiRecord', 'String', $this);
- $this->_multiRecord = (!is_numeric($multiRecordAction)) ?
- CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
+ $this->_multiRecord = (!is_numeric($multiRecordAction)) ? CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
if ($this->_multiRecord) {
$this->set('multiRecord', $this->_multiRecord);
}
array(1 => $this->_gid)
));
} elseif (empty($this->_multiRecordFields)) {
- CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)',
+ CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)',
array(1 => $this->_gid)
));
}
$fieldIds[] = CRM_Core_BAO_CustomField::getKeyID($key);
}
- $defaultValues = array( );
+ $defaultValues = array();
if ($this->_multiRecord && $this->_multiRecord == CRM_Core_Action::UPDATE) {
$defaultValues = CRM_Core_BAO_CustomValueTable::getEntityValues($this->_id, NULL, $fieldIds, TRUE);
if ($this->_recordExists == TRUE) {
case self::MODE_REGISTER:
CRM_Utils_Hook::buildProfile($this->_ufGroup['name']);
break;
+
case self::MODE_SEARCH:
CRM_Utils_Hook::searchProfile($this->_ufGroup['name']);
break;
+
default:
}
if (
($profileType != 'Contact' && !$this->_isContactActivityProfile) &&
- (($profileSubType && !empty($contactSubtypes) && (!in_array($profileSubType,$contactSubtypes))) ||
+ (($profileSubType && !empty($contactSubtypes) && (!in_array($profileSubType, $contactSubtypes))) ||
($profileType != $contactType))
) {
$return = TRUE;
1 => array($this->_recordId, 'Integer'),
2 => array($this->_id, 'Integer')
);
- CRM_Core_DAO::executeQuery($sql, $sqlParams);
- CRM_Core_Session::setStatus(ts('Your record has been deleted.'), ts('Deleted'), 'success');
+ CRM_Core_DAO::executeQuery($sql, $sqlParams);
+ CRM_Core_Session::setStatus(ts('Your record has been deleted.'), ts('Deleted'), 'success');
}
}
return;
// set the title
if ($this->_multiRecord && $this->_customGroupTitle) {
- $groupTitle = ($this->_multiRecord & CRM_Core_Action::UPDATE) ?
- 'Edit ' . $this->_customGroupTitle . ' Record' : $this->_customGroupTitle;
+ $groupTitle = ($this->_multiRecord & CRM_Core_Action::UPDATE) ? 'Edit ' . $this->_customGroupTitle . ' Record' : $this->_customGroupTitle;
} else {
$groupTitle = $this->_ufGroup['title'];
*
* @return void
*/
- public function postProcess() {}
+ public function postProcess() {
+ }
}
//specifies the action being done on a multi record field
$multiRecordAction = CRM_Utils_Request::retrieve('multiRecord', 'String', $this);
- $this->_multiRecord = (!is_numeric($multiRecordAction)) ?
- CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
+ $this->_multiRecord = (!is_numeric($multiRecordAction)) ? CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
if ($this->_multiRecord) {
$this->set('multiRecord', $this->_multiRecord);
}
//CRM-14338
// Create a unique, non-empty index for each field.
$index = $field['title'];
- if ($index === '') $index = ' ';
- while (array_key_exists($index, $labels))
+ if ($index === '') { $index = ' ';
+ }
+ while (array_key_exists($index, $labels)) {
$index .= ' ';
+ }
$labels[$index] = preg_replace('/\s+|\W+/', '_', $name);
}
}
}
-
// set the params in session
$session = CRM_Core_Session::singleton();
$session->set('profileParams', $this->_params);
NULL,
CRM_Core_Permission::EDIT
);
- $multiRecordFields = array( );
+ $multiRecordFields = array();
$fieldIDs = NULL;
$result = NULL;
$multiRecordFieldsWithSummaryListing = CRM_Core_BAO_UFGroup::shiftMultiRecordFields($fields, $multiRecordFields, TRUE);
$this->_customGroupTitle = $groupDetail[$customGroupId]['title'];
}
if ($fieldIDs && !empty($fieldIDs) && $this->_contactId) {
- $options = array( );
+ $options = array();
$returnProperities = array('html_type', 'data_type', 'date_format', 'time_format', 'default_value', 'is_required');
foreach ($fieldIDs as $key => $fieldID) {
$fieldIDs[$key] = !is_numeric($fieldID) ? CRM_Core_BAO_CustomField::getKeyID($fieldID) : $fieldID;
$param = array('id' => $fieldIDs[$key]);
- $returnValues = array( );
+ $returnValues = array();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $param, $returnValues, $returnProperities);
if ($returnValues['data_type'] == 'Date') {
$dateFields[$fieldIDs[$key]] = 1;
$supportedDataTypes = array('Float', 'String', 'Int');
$editable = in_array($spec['data_type'], $supportedDataTypes);
break;
+
case 'TextArea':
$editable = TRUE;
$fieldAttributes['data-type'] = 'textarea';
break;
+
case 'Radio':
case 'Select':
case 'Select Country':
$op = NULL;
if ($this->_pageViewType == 'profileDataView') {
- $actionParams = array('recordId' => $recId, 'gid' => $this->_profileId,
+ $actionParams = array(
+ 'recordId' => $recId,
+ 'gid' => $this->_profileId,
'id' => $this->_contactId);
$op = 'profile.multiValue.row';
}
}
}
- $headers = array( );
+ $headers = array();
if (!empty($fieldIDs)) {
foreach ($fieldIDs as $fieldID) {
$headers[$fieldID] = ($this->_pageViewType == 'profileDataView') ? $customGroupInfo[$fieldID]['fieldLabel'] : $fieldLabels[$fieldID]['label'];
}
}
$this->assign('dateFields', $dateFields);
- $this->assign('dateFieldsVals',$dateFieldsVals);
+ $this->assign('dateFieldsVals', $dateFieldsVals);
$this->assign('cgcount', $cgcount);
$this->assign('customGroupTitle', $this->_customGroupTitle);
$this->assign('headers', $headers);
$profileGID = CRM_Utils_Request::retrieve('gid', 'Integer', $controller, TRUE);
}
-
// make sure that this profile enables mapping
// CRM-8609
$isMap =
}
}
-
$multipleSelectFields = array('preferred_communication_method' => 1);
$multiRecordTableId = NULL;
if ($this->_multiRecordTableName) {
}
$row = array();
$empty = TRUE;
- $row[] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
- $result->contact_sub_type : $result->contact_type,
+ $row[] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type,
FALSE,
$result->contact_id,
$showProfileOverlay
* according to multi record custom field values
*/
public function setMultiRecordTableName($fields) {
- $customGroupId = $multiRecordTableName = NULL;
- $selectorSet = FALSE;
+ $customGroupId = $multiRecordTableName = NULL;
+ $selectorSet = FALSE;
foreach ($fields as $field => $properties) {
if (!CRM_Core_BAO_CustomField::getKeyID($field)) {