* Reference to the form object.
*/
public static function buildQuickForm(&$form) {
- if (!empty($form->_submitValues)) {
- if ($customValueCount = CRM_Utils_Array::value('hidden_custom_group_count', $form->_submitValues)) {
- if (is_array($customValueCount)) {
- if (array_key_exists(0, $customValueCount)) {
- unset($customValueCount[0]);
- }
- $form->_customValueCount = $customValueCount;
- $form->assign('customValueCount', $customValueCount);
- }
+ $customValueCount = $form->_submitValues['hidden_custom_group_count'] ?? NULL;
+ if (is_array($customValueCount)) {
+ if (array_key_exists(0, $customValueCount)) {
+ unset($customValueCount[0]);
}
+ $form->_customValueCount = $customValueCount;
+ $form->assign('customValueCount', $customValueCount);
}
CRM_Custom_Form_CustomData::buildQuickForm($form);
$communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id');
if (!empty($communicationStyle)) {
if (!empty($defaults['communication_style_id'])) {
- $defaults['communication_style_display'] = $communicationStyle[CRM_Utils_Array::value('communication_style_id', $defaults)];
+ $defaults['communication_style_display'] = $communicationStyle[$defaults['communication_style_id']];
}
else {
// Make sure the field is displayed as long as it is active, even if it is unset for this contact.
if (!empty($defaults['gender_id'])) {
$gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
- $defaults['gender_display'] = $gender[CRM_Utils_Array::value('gender_id', $defaults)];
+ $defaults['gender_display'] = $gender[$defaults['gender_id']];
}
$this->assignFieldMetadataToTemplate('Contact');
$communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id');
if (!empty($communicationStyle)) {
if (!empty($defaults['communication_style_id'])) {
- $defaults['communication_style_display'] = $communicationStyle[CRM_Utils_Array::value('communication_style_id', $defaults)];
+ $defaults['communication_style_display'] = $communicationStyle[$defaults['communication_style_id']];
}
else {
// Make sure the field is displayed as long as it is active, even if it is unset for this contact.
}
if (!empty($defaults['birth_date'])) {
- $vcard->setBirthday(CRM_Utils_Array::value('birth_date', $defaults));
+ $vcard->setBirthday($defaults['birth_date']);
}
if (!empty($defaults['home_URL'])) {
$locality = $location['city'] ?? NULL;
$region = NULL;
if (!empty($location['state_province_id'])) {
- $region = $stateProvices[CRM_Utils_Array::value('state_province_id', $location)];
+ $region = $stateProvices[$location['state_province_id']];
}
$country = NULL;
if (!empty($location['country_id'])) {
- $country = $countries[CRM_Utils_Array::value('country_id', $location)];
+ $country = $countries[$location['country_id']];
}
$postcode = $location['postal_code'] ?? NULL;
switch ($profileContactType) {
case 'Individual':
if (array_key_exists('prefix_id', $params)) {
- $honorName = CRM_Utils_Array::value(CRM_Utils_Array::value('prefix_id', $params),
+ $honorName = CRM_Utils_Array::value($params['prefix_id'],
CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id')
);
unset($profileFields['prefix_id']);
unset($profileFields['first_name']);
unset($profileFields['last_name']);
if (array_key_exists('suffix_id', $params)) {
- $honorName .= ' ' . CRM_Utils_Array::value(CRM_Utils_Array::value('suffix_id', $params),
+ $honorName .= ' ' . CRM_Utils_Array::value($params['suffix_id'],
CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id')
);
unset($profileFields['suffix_id']);
}
$pledgeParams['create_date'] = $pledgeParams['start_date'] = $pledgeParams['scheduled_date'] = date("Ymd");
if (!empty($params['start_date'])) {
- $pledgeParams['frequency_day'] = intval(date("d", strtotime(CRM_Utils_Array::value('start_date', $params))));
+ $pledgeParams['frequency_day'] = intval(date("d", strtotime($params['start_date'])));
$pledgeParams['start_date'] = $pledgeParams['scheduled_date'] = date('Ymd', strtotime(CRM_Utils_Array::value('start_date', $params)));
}
$pledgeParams['status_id'] = $contribution->contribution_status_id;
foreach ($lineItemValue as $key => $value) {
if (isset($value['tax_amount']) && isset($value['tax_rate'])) {
if (isset($dataArray[$value['tax_rate']])) {
- $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value);
+ $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + $value['tax_amount'];
}
else {
- $dataArray[$value['tax_rate']] = $value['tax_amount'] ?? NULL;
+ $dataArray[$value['tax_rate']] = $value['tax_amount'];
}
}
}
// show billing address location details, if exists
if (!empty($values['address_id'])) {
- $addressParams = ['id' => CRM_Utils_Array::value('address_id', $values)];
+ $addressParams = ['id' => $values['address_id']];
$addressDetails = CRM_Core_BAO_Address::getValues($addressParams, FALSE, 'id');
$addressDetails = array_values($addressDetails);
$values['billing_address'] = $addressDetails[0]['display'];
$addressExists = self::dataExists($value);
if (empty($value['id'])) {
- if (!empty($addresses) && array_key_exists(CRM_Utils_Array::value('location_type_id', $value), $addresses)) {
- $value['id'] = $addresses[CRM_Utils_Array::value('location_type_id', $value)];
+ if (!empty($addresses) && !empty($value['location_type_id']) && array_key_exists($value['location_type_id'], $addresses)) {
+ $value['id'] = $addresses[$value['location_type_id']];
}
}
// CRM-4377 (ab)uses the module column
if (isset($params['module'])) {
- $dao->module = $params['module'] ?? NULL;
+ $dao->module = $params['module'];
}
$dao->entity_table = $params['entity_table'] ?? NULL;
$dao->entity_id = $params['entity_id'] ?? NULL;
// CRM-4377 (ab)uses the module column
if (isset($params['module'])) {
- $dao->module = $params['module'] ?? NULL;
+ $dao->module = $params['module'];
}
$dao->entity_table = $params['entity_table'] ?? NULL;
$dao->entity_id = $params['entity_id'] ?? NULL;
// Add the billing names to the billing address, if a billing name is set
if (!empty($params['billing_first_name'])) {
- $params["address_name-{$form->_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-{$form->_bltID}"] = $params['billing_first_name'] . ' ' . CRM_Utils_Array::value('billing_middle_name', $params) . ' ' . CRM_Utils_Array::value('billing_last_name', $params);
$fields["address_name-{$form->_bltID}"] = 1;
}
*/
public static function &create(&$params) {
if (isset($params['report_header'])) {
- $params['header'] = $params['report_header'] ?? NULL;
+ $params['header'] = $params['report_header'];
}
if (isset($params['report_footer'])) {
- $params['footer'] = $params['report_footer'] ?? NULL;
+ $params['footer'] = $params['report_footer'];
}
// build navigation parameters
}
if (array_key_exists('civicrm_worldregion_name', $values)) {
- $region = $values['civicrm_worldregion_name'] ?? NULL;
- $region = ($region) ? $region : 'Unassigned';
+ $region = $values['civicrm_worldregion_name'] ?: 'Unassigned';
$grantStatistics['civicrm_worldregion_name']['title'] = ts('By Region');
self::getStatistics($grantStatistics['civicrm_worldregion_name'], $region, $values,
$awardedGrants, $awardedGrantsAmount
}
if (array_key_exists('civicrm_address_country_id', $values)) {
- $country = $countries[$values['civicrm_address_country_id']] ?? NULL;
- $country = ($country) ? $country : 'Unassigned';
+ $country = $countries[$values['civicrm_address_country_id']] ?? 'Unassigned';
$grantStatistics['civicrm_address_country_id']['title'] = ts('By Country');
self::getStatistics($grantStatistics['civicrm_address_country_id'], $country, $values,
$awardedGrants, $awardedGrantsAmount
}
if (array_key_exists('civicrm_contact_gender_id', $values)) {
- $genderLabel = $gender[$values['civicrm_contact_gender_id']] ?? NULL;
- $genderLabel = ($genderLabel) ? $genderLabel : 'Unassigned';
+ $genderLabel = $gender[$values['civicrm_contact_gender_id']] ?? 'Unassigned';
$grantStatistics['civicrm_contact_gender_id']['title'] = ts('By Gender');
self::getStatistics($grantStatistics['civicrm_contact_gender_id'], $genderLabel, $values,
$awardedGrants, $awardedGrantsAmount
// Contact's based of relationhip type
$relType = NULL;
if (!empty($params['rel'])) {
- $relation = explode('_', CRM_Utils_Array::value('rel', $params));
+ $relation = explode('_', $params['rel']);
$relType = CRM_Utils_Type::escape($relation[0], 'Integer');
$rel = CRM_Utils_Type::escape($relation[2], 'String');
}
// To keep backward compatibility for URLs generated
// by CiviCRM < 1.7, we check for the q variable as well.
-if (isset($_GET['qid'])) {
- $queue_id = $_GET['qid'] ?? NULL;
-}
-else {
- $queue_id = $_GET['q'] ?? NULL;
-}
+$queue_id = $_GET['qid'] ?? $_GET['q'] ?? NULL;
+
$url_id = $_GET['u'] ?? NULL;
if (!$url_id) {