+ $count = $countjoin = $countorder = '';
+ }
+ $list = XDB::fetchAllAssoc('SELECT e.jtid AS id, e.full_name AS field' . $count . '
+ FROM profile_job_term_enum AS e ' . $joins . $countjoin . '
+ GROUP BY e.jtid
+ ORDER BY ' . $countorder . 'field
+ LIMIT ' . DirEnumeration::AUTOCOMPLETE_LIMIT);
+ $to_cache = '';
+ if ($type == 'mentor') {
+ foreach ($list as &$item) {
+ $to_cache .= $item['field'] . "\t" . $item['nb'] . "\t" . $item['id'] . "\n";
+ $item['value'] = SearchModule::format_autocomplete($item);
+ }
+ } else {
+ foreach ($list as &$item) {
+ $to_cache .= $item['field'] . "\t" . $item['id'] . "\n";
+ $item['value'] = $item['field'];