function getSecondaryTLStdFilter($moduleid, $Options, $ogReport = "") { global $app_list_strings; if ($ogReport != "") { if (ITS4YouReports::isStoredITS4YouReport() === true) { $ogReport = ITS4YouReports::getStoredITS4YouReport(); } else { $ogReport = new ITS4YouReports($recordid); } } global $current_language; $adb = PEARDatabase::getInstance(); $module_arr = explode("x", $moduleid); $module = vtlib_getModuleNameById($module_arr[0]); $module_lbl = vtranslate($module, $module); $fieldlabel = ""; if (isset($module_arr[1]) && !empty($module_arr[1]) && is_numeric($module_arr[1])) { $field_sql = "SELECT fieldlabel FROM vtiger_field WHERE fieldid=?"; $field_result = $adb->pquery($field_sql, array($module_arr[1])); $field_row = $adb->fetchByAssoc($field_result, 0); $fieldlabel = $field_row["fieldlabel"]; if ($fieldlabel != "") { if (vtlib_isModuleActive($module)) { $fieldlabel = vtranslate($fieldlabel, $module); } else { $fieldlabel = vtranslate($fieldlabel); } } } if ($fieldlabel != "") { $optgroup_key .= "{$fieldlabel} ({$module_lbl})"; } else { $optgroup_key .= $module_lbl; } if (vtlib_isModuleActive($module)) { $ogReport->oCustomView = new CustomView(); if ($module != "") { $secmodule = explode(":", $module); $module_sarr = explode("x", $moduleid); if (isset($module_sarr[1]) && !empty($module_sarr[1])) { $fieldid = ":" . $module_sarr[1]; } for ($i = 0; $i < count($secmodule); $i++) { $result = $ogReport->getStdCriteriaByModule($secmodule[$i]); $mod_strings = return_module_language($current_language, $secmodule[$i]); if (isset($result)) { foreach ($result as $key => $value) { //$fieldid = get_field_id($key); if (isset($mod_strings[$value])) { $Options[$optgroup_key][] = array("value" => $key . "{$fieldid}", 'text' => vtranslate($value, $secmodule[$i])); } else { $Options[vtranslate($secmodule[$i], $secmodule[$i])][] = array("value" => $key . "{$fieldid}", 'text' => $value); } } } } } } return $Options; }