当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_Page_AJAX::autocompleteResults方法代码示例

本文整理汇总了PHP中CRM_Core_Page_AJAX::autocompleteResults方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Page_AJAX::autocompleteResults方法的具体用法?PHP CRM_Core_Page_AJAX::autocompleteResults怎么用?PHP CRM_Core_Page_AJAX::autocompleteResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_Page_AJAX的用法示例。


在下文中一共展示了CRM_Core_Page_AJAX::autocompleteResults方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getContactList

 /**
  * @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');
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:37,代码来源:AJAX.php

示例2: eventFee

 /**
  * Function for building EventFee combo box
  */
 function eventFee()
 {
     $name = trim(CRM_Utils_Type::escape($_GET['s'], 'String'));
     if (!$name) {
         $name = '%';
     }
     $whereClause = "cv.label LIKE '{$name}%' ";
     $query = "SELECT DISTINCT (\ncv.label\n), cv.id\nFROM civicrm_price_field_value cv\nLEFT JOIN civicrm_price_field cf ON cv.price_field_id = cf.id\nLEFT JOIN civicrm_price_set_entity ce ON ce.price_set_id = cf.price_set_id\nWHERE ce.entity_table = 'civicrm_event' AND {$whereClause}\nGROUP BY cv.label";
     $dao = CRM_Core_DAO::executeQuery($query);
     $results = array();
     while ($dao->fetch()) {
         $results[$dao->id] = $dao->label;
     }
     CRM_Core_Page_AJAX::autocompleteResults($results);
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:18,代码来源:AJAX.php

示例3: getPermissionedEmployer

 /**
  * Function to obtain list of permissioned employer for the given contact-id.
  */
 static function getPermissionedEmployer()
 {
     $cid = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
     $name = trim(CRM_Utils_Type::escape($_GET['s'], 'String'));
     $name = str_replace('*', '%', $name);
     $elements = CRM_Contact_BAO_Relationship::getPermissionedEmployer($cid, $name);
     $results = array();
     if (!empty($elements)) {
         foreach ($elements as $cid => $name) {
             $results[$cid] = $name['name'];
         }
     }
     CRM_Core_Page_AJAX::autocompleteResults($results);
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:17,代码来源:AJAX.php


注:本文中的CRM_Core_Page_AJAX::autocompleteResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。