示例#1
0
 /**
  * Function searches the records in the module, if parentId & parentModule
  * is given then searches only those records related to them.
  * @param <String> $searchValue - Search value
  * @param <Integer> $parentId - parent recordId
  * @param <String> $parentModule - parent module name
  * @return <Array of Vtiger_Record_Model>
  */
 public function searchRecord($searchValue, $parentId = false, $parentModule = false, $relatedModule = false)
 {
     if (!empty($searchValue) && empty($parentId) && empty($parentModule) && in_array($relatedModule, getInventoryModules())) {
         $matchingRecords = Products_Record_Model::getSearchResult($searchValue, $this->getName());
     } else {
         return parent::searchRecord($searchValue);
     }
     return $matchingRecords;
 }
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["pwqcmepsgy"] = "adb";
     $adwshrlpqh = "products";
     ${${"GLOBALS"}["pwqcmepsgy"]} = \PearDatabase::getInstance();
     ${$adwshrlpqh} = Products_Record_Model::getSearchResult($request->get("query"), "Products");
     $acypysvneb = "services";
     ${$acypysvneb} = Services_Record_Model::getSearchResult($request->get("query"), "Services");
     ${${"GLOBALS"}["vocxjbdqjl"]} = array();
     ${"GLOBALS"}["hhfjmudmehbv"] = "services";
     foreach (${${"GLOBALS"}["egjkkwquu"]}["Products"] as ${${"GLOBALS"}["rywkvygs"]}) {
         $lwwocgvf = "return";
         ${$lwwocgvf}["results"][] = array("group" => "Products", "text" => $result->get("label"), "id" => $result->getId());
     }
     foreach (${${"GLOBALS"}["hhfjmudmehbv"]}["Services"] as ${${"GLOBALS"}["rywkvygs"]}) {
         ${${"GLOBALS"}["vocxjbdqjl"]}["results"][] = array("group" => "Services", "text" => $result->get("label"), "id" => $result->getId());
     }
     echo json_encode(${${"GLOBALS"}["vocxjbdqjl"]});
     exit;
 }