You are here

function spaces_casetracker_users_autocomplete in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces_casetracker/spaces_casetracker.module \spaces_casetracker_users_autocomplete()

Autocomplete callback. This should be moved into casetracker eventually.

1 string reference to 'spaces_casetracker_users_autocomplete'
spaces_casetracker_menu in spaces_casetracker/spaces_casetracker.module
Implementation of hook_menu()

File

spaces_casetracker/spaces_casetracker.module, line 301

Code

function spaces_casetracker_users_autocomplete($gid, $string) {
  $matches = array();
  $result = db_query_range("SELECT name FROM {users} u INNER JOIN {og_uid} og ON u.uid = og.uid WHERE og.nid = %d AND LOWER(u.name) LIKE LOWER('%s%%')", $gid, $string, 0, 10);
  while ($user = db_fetch_object($result)) {
    $matches[$user->name] = check_plain($user->name);
  }
  print drupal_to_js($matches);
  exit;
}