You are here

function pmteam_autocomplete_combo in Drupal PM (Project Management) 7

Function to return an autocomplete list for PM Teams and People

File

pmteam/pmteam.module, line 406
Functionality for the Project Management Team module Organized into the following sections:

Code

function pmteam_autocomplete_combo($string = '') {
  $matches = array();
  if ($string) {

    // @todo Convert to DBTNG
    $s = "SELECT title FROM {node} AS n WHERE n.type='pmteam' AND LOWER(title) LIKE LOWER('%s%%')";

    // ->addTag('node_access')
    $result = db_query_range($s, $string, 0, 10);
    while ($obj = db_fetch_object($result)) {
      $matches[$obj->title] = check_plain($obj->title);
    }
  }
  drupal_json($matches);
}