$esx->Owner = $dept->DeptID; $vmList = $esx->GetVMListbyOwner(); $cab->AssignedTo = $dept->DeptID; $cabList = $cab->Search(true); //PDUs have no ownership information so don't search them $resultcount = count($devList) + count($cabList) + count($vmList); $title = __("Owner search results for") . " "{$searchTerm}""; } elseif ($searchKey == 'asset') { $dev->AssetTag = $searchTerm; $devList = $dev->SearchDevicebyAssetTag(); $resultcount = count($devList); $title = __("Asset tag search results for") . " "{$searchTerm}""; } elseif ($searchKey == "ctag") { // TODO: this could be enhanced to allow searching for a specific custom attribute $devList = $dev->SearchByCustomTag($searchTerm); $cabList = $cab->SearchByCustomTag($searchTerm); $resultcount = count($devList) + count($cabList); $title = __("Custom tag search results for") . " "{$searchTerm}""; } elseif ($searchKey == "cattr") { $devList = $dev->SearchByCustomAttribute($searchTerm); $resultcount = count($devList); $title = __("Custom attribute search results for") . " "{$searchTerm}""; } elseif ($searchKey == "notes") { $dev->Notes = $searchTerm; $devList = $dev->LooseSearch(true); $cab->Notes = $searchTerm; $cabList = $cab->LooseSearch(true); // DevicePorts and PowerPorts use the same structures and functions so // we're just looping the search to not repeat code foreach (array('DevicePorts', 'PowerPorts') as $pt) { $p = new $pt();