CRM-15926 - CRM_Contact_Page_AJAX::getContactList - Remove old, unused helper
authorTim Otten <totten@civicrm.org>
Mon, 9 Feb 2015 23:21:06 +0000 (15:21 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 10 Feb 2015 13:22:02 +0000 (05:22 -0800)
CRM/Contact/Page/AJAX.php
CRM/Core/Page/AJAX.php

index 268b7f8cd676efbe3294eb9c279489f79cb40362..21dbe7ef0d6dcab09fa45daff59281b9f8695aa0 100644 (file)
@@ -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
    *
index 0b5f72fae6dd279ce08c77e6f1a1aec2e6aeb421..315b8fba3d4f8bcb4bbad31c27054dfa1ce93d33 100644 (file)
@@ -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();
-  }
 }