* Todo: Migrate contact reference fields to use EntityRef
*/
public static function contactReference() {
- $name = CRM_Utils_Array::value('term', $_GET);
+ $name = $_GET['term'] ?? NULL;
$name = CRM_Utils_Type::escape($name, 'String');
$cfID = CRM_Utils_Type::escape($_GET['id'], 'Positive');
$filterParams = [];
parse_str($cf['filter'], $filterParams);
- $action = CRM_Utils_Array::value('action', $filterParams);
+ $action = $filterParams['action'] ?? NULL;
if (!empty($action) && !in_array($action, ['get', 'lookup'])) {
CRM_Utils_System::civiExit(1);
}
* Fetch PCP ID by PCP Supporter sort_name, also displays PCP title and associated Contribution Page title
*/
public static function getPCPList() {
- $name = CRM_Utils_Array::value('term', $_GET);
+ $name = $_GET['term'] ?? NULL;
$name = CRM_Utils_Type::escape($name, 'String');
$limit = $max = Civi::settings()->get('search_autocomplete_count');
*/
public static function getContactEmail() {
$queryStrings = [];
- $name = CRM_Utils_Array::value('name', $_GET);
+ $name = $_GET['name'] ?? NULL;
if ($name) {
$name = CRM_Utils_Type::escape($name, 'String');
$wildCard = Civi::settings()->get('includeWildCardInName') ? '%' : '';
$sqlParmas = [];
//check for mobile type
$phoneTypes = CRM_Core_OptionGroup::values('phone_type', TRUE, FALSE, FALSE, NULL, 'name');
- $mobileType = CRM_Utils_Array::value('Mobile', $phoneTypes);
+ $mobileType = $phoneTypes['Mobile'] ?? NULL;
$name = CRM_Utils_Request::retrieveValue('name', 'String', NULL, FALSE, 'GET');
if ($name) {
public static function dashboard() {
switch ($_REQUEST['op']) {
case 'save_columns':
- CRM_Core_BAO_Dashboard::saveDashletChanges($_REQUEST['columns']);
+ CRM_Core_BAO_Dashboard::saveDashletChanges($_REQUEST['columns'] ?? NULL);
break;
case 'delete_dashlet':
$dashletID = CRM_Utils_Type::escape($_REQUEST['dashlet_id'], 'Positive');
- CRM_Core_BAO_Dashboard::deleteDashlet($dashletID);
+ CRM_Core_DAO_Dashboard::deleteRecord(['id' => $dashletID]);
}
CRM_Utils_System::civiExit();
$dir = CRM_Utils_Type::escape($orderInfo['dir'], 'MysqlOrderByDirection', FALSE);
}
}
- $columnDetails = CRM_Utils_Array::value($orderColumnNumber, $_REQUEST['columns']);
+ $columnDetails = $_REQUEST['columns'][$orderColumnNumber] ?? NULL;
}
if (!empty($columnDetails)) {
switch ($columnDetails['data']) {
$count = 0;
foreach ($dupePairs as $key => $pairInfo) {
$pair = $pairInfo['data'];
- $srcContactSubType = CRM_Utils_Array::value('src_contact_sub_type', $pairInfo);
- $dstContactSubType = CRM_Utils_Array::value('dst_contact_sub_type', $pairInfo);
+ $srcContactSubType = $pairInfo['src_contact_sub_type'] ?? NULL;
+ $dstContactSubType = $pairInfo['dst_contact_sub_type'] ?? NULL;
$srcTypeImage = CRM_Contact_BAO_Contact_Utils::getImage($srcContactSubType ?
$srcContactSubType : $pairInfo['src_contact_type'],
FALSE,
$searchRows[$count]['is_selected_input'] = "<input type='checkbox' class='crm-dedupe-select' name='pnid_{$pairInfo['prevnext_id']}' value='{$pairInfo['is_selected']}' onclick='toggleDedupeSelect(this)'>";
$searchRows[$count]['src_image'] = $srcTypeImage;
$searchRows[$count]['src'] = CRM_Utils_System::href($pair['srcName'], 'civicrm/contact/view', "reset=1&cid={$pairInfo['entity_id2']}");
- $searchRows[$count]['src_email'] = CRM_Utils_Array::value('src_email', $pairInfo);
- $searchRows[$count]['src_street'] = CRM_Utils_Array::value('src_street', $pairInfo);
- $searchRows[$count]['src_postcode'] = CRM_Utils_Array::value('src_postcode', $pairInfo);
+ $searchRows[$count]['src_email'] = $pairInfo['src_email'] ?? NULL;
+ $searchRows[$count]['src_street'] = $pairInfo['src_street'] ?? NULL;
+ $searchRows[$count]['src_postcode'] = $pairInfo['src_postcode'] ?? NULL;
$searchRows[$count]['dst_image'] = $dstTypeImage;
$searchRows[$count]['dst'] = CRM_Utils_System::href($pair['dstName'], 'civicrm/contact/view', "reset=1&cid={$pairInfo['entity_id1']}");
- $searchRows[$count]['dst_email'] = CRM_Utils_Array::value('dst_email', $pairInfo);
- $searchRows[$count]['dst_street'] = CRM_Utils_Array::value('dst_street', $pairInfo);
- $searchRows[$count]['dst_postcode'] = CRM_Utils_Array::value('dst_postcode', $pairInfo);
+ $searchRows[$count]['dst_email'] = $pairInfo['dst_email'] ?? NULL;
+ $searchRows[$count]['dst_street'] = $pairInfo['dst_street'] ?? NULL;
+ $searchRows[$count]['dst_postcode'] = $pairInfo['dst_postcode'] ?? NULL;
$searchRows[$count]['conflicts'] = str_replace("',", "',<br/>", CRM_Utils_Array::value('conflicts', $pair));
- $searchRows[$count]['weight'] = CRM_Utils_Array::value('weight', $pair);
+ $searchRows[$count]['weight'] = $pair['weight'] ?? NULL;
if (!empty($pairInfo['data']['canMerge'])) {
$mergeParams = [
*/
public static function getSearchOptionsFromRequest() {
$searchParams = [];
- $searchData = CRM_Utils_Array::value('search', $_REQUEST);
- $searchData['value'] = CRM_Utils_Type::escape($searchData['value'], 'String');
+ $searchData = $_REQUEST['search'] ?? NULL;
+ $searchData['value'] = CRM_Utils_Type::escape($searchData['value'] ?? NULL, 'String');
$selectorElements = [
'is_selected',
'is_selected_input',
* @return bool
*/
public static function isOrQuery() {
- $searchData = CRM_Utils_Array::value('search', $_REQUEST);
+ $searchData = $_REQUEST['search'] ?? NULL;
return !empty($searchData['value']);
}
* Used to store selected contacts across multiple pages in advanced search.
*/
public static function selectUnselectContacts() {
- $name = CRM_Utils_Array::value('name', $_REQUEST);
- $cacheKey = CRM_Utils_Array::value('qfKey', $_REQUEST);
+ $name = $_REQUEST['name'] ?? NULL;
+ $cacheKey = $_REQUEST['qfKey'] ?? NULL;
$state = CRM_Utils_Array::value('state', $_REQUEST, 'checked');
$variableType = CRM_Utils_Array::value('variableType', $_REQUEST, 'single');