/**
  * Fill the response array with the suggest values
  *
  * @param String value	
  *		Note: value is preceeded with "_" 
  * @param String searchFor
  * @param &Array response
  * @param &Array row
  */
 function suggestValue($value, $searchFor, &$response, &$row)
 {
     if (!GetGlobalData("handleSearchSuggestInLookup", true) || $this->lookupType == LT_LISTOFVALUES || $this->isSearchByDispalyedFieldAllowed()) {
         parent::suggestValue($value, $searchFor, $response, $row);
         return;
     }
     // "_" is added to convert number type to string in lookupsuggest.php ($value)
     $lookupSQL = $this->getLookupSQL("", substr($value, 1), false, true, false, true, true);
     $this->fillLookupFieldsIndexes();
     $qResult = $this->lookupConnection->query($lookupSQL);
     if ($data = $qResult->fetchNumeric()) {
         // "_" is added to convert number type to string
         if ($this->isDisplayFieldEncrypted) {
             $displayFieldName = $this->lookupType == LT_QUERY ? $this->displayFieldName : $this->field;
             $lookup_value = $this->ciphererDisplay->DecryptField($displayFieldName, "_" . $data[$this->displayFieldIndex]);
         } else {
             $lookup_value = "_" . $data[$this->displayFieldIndex];
         }
         parent::suggestValue($lookup_value, $searchFor, $response, $row);
     }
 }
Beispiel #2
0
 function suggestValue($value, $searchFor, &$response, &$row)
 {
     if (!GetGlobalData("handleSearchSuggestInLookup", true)) {
         parent::suggestValue($value, $searchFor, $response, $row);
         return;
     }
     global $conn;
     $lookupSQL = buildLookupSQL($this->lookupPageType, $this->field, $this->pageObject->tName, "", $value, false, true, false, true, true, true);
     $this->fillLookupFieldsIndexes();
     $rs_lookup = db_query($lookupSQL, $conn);
     if ($data = db_fetch_numarray($rs_lookup)) {
         if ($this->isDisplayFieldEncrypted) {
             $lookup_value = $this->ciphererDisplay->DecryptField($this->lookupType == LT_QUERY ? $this->displayFieldName : $this->field, $data[$this->displayFieldIndex]);
         } else {
             $lookup_value = $data[$this->displayFieldIndex];
         }
         parent::suggestValue($lookup_value, $searchFor, $response, $row);
     }
 }