From 9974506a133755000dc4bdbc7b4c895cd14956eb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 9 Feb 2015 15:21:06 -0800 Subject: [PATCH] CRM-15926 - CRM_Contact_Page_AJAX::getContactList - Remove old, unused helper --- CRM/Contact/Page/AJAX.php | 57 --------------------------------------- CRM/Core/Page/AJAX.php | 21 --------------- 2 files changed, 78 deletions(-) diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 268b7f8cd6..21dbe7ef0d 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -45,63 +45,6 @@ class CRM_Contact_Page_AJAX { const AUTOCOMPLETE_TTL = 21600; // 6hr; 6*60*60 - /** - * @deprecated - */ - static function getContactList() { - // if context is 'customfield' - if (CRM_Utils_Array::value('context', $_GET) == 'customfield') { - return self::contactReference(); - } - - $params = array('version' => 3, 'check_permissions' => TRUE); - - // String params - // FIXME: param keys don't match input keys, using this array to translate - $whitelist = array( - 's' => 'name', - 'fieldName' => 'field_name', - 'tableName' => 'table_name', - 'context' => 'context', - 'rel' => 'rel', - 'contact_sub_type' => 'contact_sub_type', - 'contact_type' => 'contact_type' - ); - foreach ($whitelist as $key => $param) { - if (!empty($_GET[$key])) { - $params[$param] = $_GET[$key]; - } - } - - //CRM-10687: Allow quicksearch by multiple fields - if (!empty($params['field_name'])) { - if ($params['field_name'] == 'phone_numeric') { - $params['name'] = preg_replace('/[^\d]/', '', $params['name']); - } - if (!$params['name']) { - CRM_Utils_System::civiExit(); - } - } - - // Numeric params - $whitelist = array( - 'limit', - 'org', - 'employee_id', - 'cid', - 'id', - 'cmsuser', - ); - foreach ($whitelist as $key) { - if (!empty($_GET[$key]) && is_numeric($_GET[$key])) { - $params[$key] = $_GET[$key]; - } - } - - $result = civicrm_api('Contact', 'getquick', $params); - CRM_Core_Page_AJAX::autocompleteResults(CRM_Utils_Array::value('values', $result), 'data'); - } - /** * Ajax callback for custom fields of type ContactReference * diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index 0b5f72fae6..315b8fba3d 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -208,26 +208,5 @@ class CRM_Core_Page_AJAX { header("Cache-Control: max-age=$year, public"); } - /** - * Send autocomplete results to the client. Input can be a simple or nested array. - * @param array $results - If nested array, also provide: - * @param string $val - array key to use as the value - * @param string $key - array key to use as the key - * @deprecated - */ - static function autocompleteResults($results, $val='label', $key='id') { - $output = array(); - if (is_array($results)) { - foreach ($results as $k => $v) { - if (is_array($v)) { - echo $v[$val] . '|' . $v[$key] . "\n"; - } - else { - echo "$v|$k\n"; - } - } - } - CRM_Utils_System::civiExit(); - } } -- 2.25.1