);
}
else {
- $q = "action=view&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . CRM_Utils_Array::value('source_contact_id', $params) . "&context=home";
+ $q = "action=view&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . ($params['source_contact_id'] ?? '') . "&context=home";
if ($activity->activity_type_id != CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Email')) {
$url = CRM_Utils_System::url('civicrm/activity', $q);
if ($activity->activity_type_id == CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Print PDF Letter')) {
}
else {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/activity/add',
- "action=update&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . CRM_Utils_Array::value('source_contact_id', $params) . "&context=home"
+ "action=update&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . ($params['source_contact_id'] ?? '') . "&context=home"
);
}
if (CRM_Core_Permission::check("delete activities")) {
$recentOther['deleteUrl'] = CRM_Utils_System::url('civicrm/activity',
- "action=delete&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . CRM_Utils_Array::value('source_contact_id', $params) . "&context=home"
+ "action=delete&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . ($params['source_contact_id'] ?? '') . "&context=home"
);
}
}
$url = CRM_Utils_System::url('civicrm/activity/view', $q);
if (CRM_Core_Permission::check('delete activities')) {
$recentOther['deleteUrl'] = CRM_Utils_System::url('civicrm/activity',
- "action=delete&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . CRM_Utils_Array::value('source_contact_id', $params) . "&context=home"
+ "action=delete&reset=1&id={$activity->id}&atype={$activity->activity_type_id}&cid=" . ($params['source_contact_id'] ?? '') . "&context=home"
);
}
}
$casesList[$key]['date'] = sprintf('<a class="action-item crm-hover-button" href="%s" title="%s">%s</a>',
CRM_Utils_System::url('civicrm/case/activity/view', ['reset' => 1, 'cid' => $case['contact_id'], 'aid' => $case['activity_id']]),
ts('View activity'),
- CRM_Utils_Array::value($case['activity_type_id'], $activityTypeLabels)
+ $activityTypeLabels[$case['activity_type_id']] ?? ''
);
}
else {
$status,
CRM_Utils_System::url('civicrm/case/activity/view', ['reset' => 1, 'cid' => $case['contact_id'], 'aid' => $case['activity_id']]),
ts('View activity'),
- CRM_Utils_Array::value($case['activity_type_id'], $activityTypeLabels)
+ $activityTypeLabels[$case['activity_type_id']] ?? ''
);
}
}
}
if ($values['is_email_receipt']) {
- $sendTemplateParams['from'] = CRM_Utils_Array::value('receipt_from_name', $values) . ' <' . $values['receipt_from_email'] . '>';
+ $sendTemplateParams['from'] = ($values['receipt_from_name'] ?? '') . ' <' . $values['receipt_from_email'] . '>';
$sendTemplateParams['toName'] = $displayName;
$sendTemplateParams['toEmail'] = $email;
$sendTemplateParams['cc'] = $values['cc_receipt'] ?? NULL;
$pcpId = $pcpInfo['pcp_id'] ?? NULL;
$pcpTitle = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $pcpId, 'title');
$contributionPageTitle = CRM_PCP_BAO_PCP::getPcpPageTitle($pcpId, 'contribute');
- $defaults['pcp_made_through'] = CRM_Utils_Array::value('sort_name', $pcpInfo) . " :: " . $pcpTitle . " :: " . $contributionPageTitle;
+ $defaults['pcp_made_through'] = ($pcpInfo['sort_name'] ?? '') . " :: " . $pcpTitle . " :: " . $contributionPageTitle;
$defaults['pcp_made_through_id'] = $pcpInfo['pcp_id'] ?? NULL;
$defaults['pcp_display_in_roll'] = $pcpInfo['pcp_display_in_roll'] ?? NULL;
$defaults['pcp_roll_nickname'] = $pcpInfo['pcp_roll_nickname'] ?? NULL;
if (!empty($params['instanceURL'])) {
$query = "SELECT id
FROM `civicrm_dashboard`
- WHERE url LIKE '" . CRM_Utils_Array::value('instanceURL', $params) . "&%'";
+ WHERE url LIKE '" . ($params['instanceURL'] ?? '') . "&%'";
$dashboardID = CRM_Core_DAO::singleValueQuery($query);
}
*/
protected function prepareParamsForPaymentProcessor($params) {
// also add location name to the array
- $params["address_name-{$this->_bltID}"] = CRM_Utils_Array::value('billing_first_name', $params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $params) . ' ' . CRM_Utils_Array::value('billing_last_name', $params);
+ $params["address_name-{$this->_bltID}"] = ($params['billing_first_name'] ?? '') . ' ' . ($params['billing_middle_name'] ?? '') . ' ' . ($params['billing_last_name'] ?? '');
$params["address_name-{$this->_bltID}"] = trim($params["address_name-{$this->_bltID}"]);
// Add additional parameters that the payment processors are used to receiving.
if (!empty($params["billing_state_province_id-{$this->_bltID}"])) {
];
}
else {
- $sendTemplateParams['from'] = CRM_Utils_Array::value('confirm_from_name', $values['event']) . " <" . CRM_Utils_Array::value('confirm_from_email', $values['event']) . ">";
+ $sendTemplateParams['from'] = ($values['event']['confirm_from_name'] ?? '') . " <" . ($values['event']['confirm_from_email'] ?? '') . ">";
$sendTemplateParams['toName'] = $displayName;
$sendTemplateParams['toEmail'] = $notifyEmail;
$sendTemplateParams['autoSubmitted'] = TRUE;
$extIdentifier = $contactFields['external_identifier'] ?? NULL;
if ($extIdentifier) {
$tmpContactField['external_identifier'] = $extIdentifier;
- $tmpContactField['external_identifier']['title'] = CRM_Utils_Array::value('title', $extIdentifier) . ' (match to contact)';
+ $tmpContactField['external_identifier']['title'] = ($extIdentifier['title'] ?? '') . ' (match to contact)';
}
$tmpFields['participant_contact_id']['title'] = $tmpFields['participant_contact_id']['title'] . ' (match to contact)';
$title = NULL;
if ($this->_id) {
if ($this->_isTemplate) {
- $title = ts('Edit Event Template') . ' - ' . CRM_Utils_Array::value('template_title', $eventInfo);
+ $title = ts('Edit Event Template') . ' - ' . ($eventInfo['template_title'] ?? '');
}
else {
$configureText = $this->_isRepeatingEvent ? ts('Configure Repeating Event') : ts('Configure Event');
- $title = $configureText . ' - ' . CRM_Utils_Array::value('title', $eventInfo);
+ $title = $configureText . ' - ' . ($eventInfo['title'] ?? '');
}
}
elseif ($this->_action & CRM_Core_Action::ADD) {
// also add location name to the array
$params["address_name-{$this->_bltID}"]
- = CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
- CRM_Utils_Array::value('billing_middle_name', $params) . ' ' .
+ = ($params['billing_first_name'] ?? '') . ' ' .
+ ($params['billing_middle_name'] ?? '') . ' ' .
CRM_Utils_Array::value('billing_last_name', $params);
$params["address_name-{$this->_bltID}"] = trim($params["address_name-{$this->_bltID}"]);
$this->setTitle(ts('View Event Registration for') . ' ' . $displayName);
$roleId = $values[$participantID]['role_id'] ?? NULL;
- $title = $displayName . ' (' . CRM_Utils_Array::value($roleId, $participantRoles) . ' - ' . $eventTitle . ')';
+ $title = $displayName . ' (' . ($participantRoles[$roleId] ?? '') . ' - ' . $eventTitle . ')';
$sep = CRM_Core_DAO::VALUE_SEPARATOR;
$viewRoles = [];
$engineChanged = isset($tableSpec['engine']) && (strtoupper($tableSpec['engine']) != $currentEngine);
$engineConfigChanged = isset($tableSpec['engine_config']) && (strtoupper($tableSpec['engine_config']) != $this->getEngineConfigForLogTable($logTable));
if ($engineChanged || ($engineConfigChanged && $params['updateChangedEngineConfig'])) {
- $alterSql[] = "ENGINE=" . $tableSpec['engine'] . " " . CRM_Utils_Array::value('engine_config', $tableSpec);
+ $alterSql[] = "ENGINE=" . $tableSpec['engine'] . " " . ($tableSpec['engine_config'] ?? '');
}
if (!empty($tableSpec['indexes'])) {
$indexes = $this->getIndexesForTable($logTable);
);
//append comment if added while forwarding.
if (count($comment)) {
- $message->_txtbody = CRM_Utils_Array::value('body_text', $comment) . $message->_txtbody;
+ $message->_txtbody = ($comment['body_text'] ?? '') . $message->_txtbody;
if (!empty($comment['body_html'])) {
$message->_htmlbody = $comment['body_html'] . '<br />---------------Original message---------------------<br />' . $message->_htmlbody;
}
}
elseif (empty($formatted['is_override'])) {
if (empty($calcStatus)) {
- throw new CRM_Core_Exception('Status in import row (' . CRM_Utils_Array::value('status_id', $formatValues) . ') does not match calculated status based on your configured Membership Status Rules. Record was not imported.', CRM_Import_Parser::ERROR);
+ throw new CRM_Core_Exception('Status in import row (' . ($formatValues['status_id'] ?? '') . ') does not match calculated status based on your configured Membership Status Rules. Record was not imported.', CRM_Import_Parser::ERROR);
}
if ($formatted['status_id'] != $calcStatus['id']) {
//Status Hold" is either NOT mapped or is FALSE
- throw new CRM_Core_Exception('Status in import row (' . CRM_Utils_Array::value('status_id', $formatValues) . ') does not match calculated status based on your configured Membership Status Rules (' . $calcStatus['name'] . '). Record was not imported.', CRM_Import_Parser::ERROR);
+ throw new CRM_Core_Exception('Status in import row (' . ($formatValues['status_id'] ?? '') . ') does not match calculated status based on your configured Membership Status Rules (' . $calcStatus['name'] . '). Record was not imported.', CRM_Import_Parser::ERROR);
}
}
}
$contributionTypes = CRM_Contribute_PseudoConstant::financialType();
- $title = CRM_Contact_BAO_Contact::displayName($pledge->contact_id) . ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format($pledge->amount, $pledge->currency) . ' - ' . CRM_Utils_Array::value($pledge->financial_type_id, $contributionTypes) . ')';
+ $title = CRM_Contact_BAO_Contact::displayName($pledge->contact_id) . ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format($pledge->amount, $pledge->currency) . ' - ' . ($contributionTypes[$pledge->financial_type_id] ?? '') . ')';
// add the recently created Pledge
CRM_Utils_Recent::add($title,
$keys = array_keys($contact['values']);
$contactId = array_pop($keys);
- $this->assertEquals(0, $contact['values'][$contactId]['api.address.create']['is_error'], ' error message: ' . CRM_Utils_Array::value('error_message', $contact['values'][$contactId]['api.address.create'])
+ $this->assertEquals(0, $contact['values'][$contactId]['api.address.create']['is_error'], ' error message: ' . ($contact['values'][$contactId]['api.address.create']['error_message'] ?? '')
);
$activityParams = [