assign("MOD", $mod_strings); $report_column->assign("APP", $app_strings); $report_column->assign("IMAGE_PATH",$image_path); $report_column->assign("THEME_PATH",$theme_path); if(isset($_REQUEST["record"]) && $_REQUEST['record']!='') { $recordid = vtlib_purify($_REQUEST["record"]); $oReport = new Reports($recordid); $BLOCK1 = getPrimaryColumnsHTML($oReport->primodule); $oRep = new Reports(); $secondarymodule = ''; $secondarymodules =Array(); if(!empty($oRep->related_modules[$oReport->primodule])) { foreach($oRep->related_modules[$oReport->primodule] as $key=>$value){ if(isset($_REQUEST["secondarymodule_".$value]))$secondarymodules []= $_REQUEST["secondarymodule_".$value]; } } $secondarymodule = implode(":",$secondarymodules); $oReport->secmodule = $secondarymodule; $BLOCK1 .= getSecondaryColumnsHTML($oReport->secmodule); $BLOCK2 = $oReport->getSelectedColumnsList($recordid); $report_column->assign("BLOCK1",$BLOCK1); $report_column->assign("BLOCK2",$BLOCK2); }else { $primarymodule = vtlib_purify($_REQUEST["primarymodule"]); $BLOCK1 = getPrimaryColumnsHTML($primarymodule); $ogReport = new Reports(); if(!empty($ogReport->related_modules[$primarymodule])) { foreach($ogReport->related_modules[$primarymodule] as $key=>$value){ $BLOCK1 .= getSecondaryColumnsHTML($_REQUEST["secondarymodule_".$value]); } } $report_column->assign("BLOCK1",$BLOCK1); } /** Function to formulate the vtiger_fields for the primary modules * This function accepts the module name * as arguments and generates the vtiger_fields for the primary module as * a HTML Combo values */ function getPrimaryColumnsHTML($module) { global $ogReport; global $app_list_strings; global $app_strings; global $current_language; $id_added=false; $mod_strings = return_module_language($current_language,$module); $block_listed = array(); foreach($ogReport->module_list[$module] as $key=>$value) { if(isset($ogReport->pri_module_columnslist[$module][$value]) && !$block_listed[$value]) { $block_listed[$value] = true; $shtml .= ""; if($id_added==false){ $shtml .= ""; $id_added=true; } foreach($ogReport->pri_module_columnslist[$module][$value] as $field=>$fieldlabel) { if(isset($mod_strings[$fieldlabel])) { $shtml .= ""; }else { $shtml .= ""; } } } } return $shtml; } /** Function to formulate the vtiger_fields for the secondary modules * This function accepts the module name * as arguments and generates the vtiger_fields for the secondary module as * a HTML Combo values */ function getSecondaryColumnsHTML($module) { global $ogReport; global $app_list_strings,$app_strings; global $current_language; if($module != "") { $secmodule = explode(":",$module); for($i=0;$i < count($secmodule) ;$i++) { $mod_strings = return_module_language($current_language,$secmodule[$i]); if(vtlib_isModuleActive($secmodule[$i])){ $block_listed = array(); foreach($ogReport->module_list[$secmodule[$i]] as $key=>$value) { if(isset($ogReport->sec_module_columnslist[$secmodule[$i]][$value]) && !$block_listed[$value]) { $block_listed[$value] = true; $shtml .= ""; foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$value] as $field=>$fieldlabel) { if(isset($mod_strings[$fieldlabel])) { $shtml .= ""; }else { $shtml .= ""; } } } } } } } return $shtml; } $report_column->display("ReportColumns.tpl"); ?>