You are here

function casetracker_autocomplete in Case Tracker 5

Same name and namespace in other branches
  1. 6 casetracker.module \casetracker_autocomplete()
  2. 7 casetracker.module \casetracker_autocomplete()

Retrieve a pipe delimited string of autocomplete suggestions for existing users. Stolen from user_autocomplete. Eventually this will be expanded to include OG specific users subscribed to a project.

1 string reference to 'casetracker_autocomplete'
casetracker_menu in ./casetracker.module
Implementation of hook_menu().

File

./casetracker.module, line 1387
Enables the handling of projects and their cases.

Code

function casetracker_autocomplete($string) {
  $matches = array();
  $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $string, 0, 10);
  while ($user = db_fetch_object($result)) {
    $matches[$user->name] = check_plain($user->name);
  }
  print drupal_to_js($matches);
  exit;
}