[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 /********************************************************************************* 3 ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 * 10 ********************************************************************************/ 11 require_once ('Smarty_setup.php'); 12 require_once ("data/Tracker.php"); 13 require_once('themes/'.$theme.'/layout_utils.php'); 14 require_once ('include/logging.php'); 15 require_once ('include/utils/utils.php'); 16 require_once ('modules/Reports/Reports.php'); 17 require_once ('include/database/PearDatabase.php'); 18 19 global $app_strings; 20 global $app_list_strings; 21 global $mod_strings; 22 $current_module_strings = return_module_language($current_language, 'Reports'); 23 24 global $list_max_entries_per_page; 25 global $urlPrefix; 26 27 $log = LoggerManager::getLogger('report_type'); 28 29 global $currentModule; 30 global $image_path; 31 global $theme; 32 $theme_path="themes/".$theme."/"; 33 $report_column=new vtigerCRM_Smarty; 34 $report_column->assign("MOD", $mod_strings); 35 $report_column->assign("APP", $app_strings); 36 $report_column->assign("IMAGE_PATH",$image_path); 37 $report_column->assign("THEME_PATH",$theme_path); 38 if(isset($_REQUEST["record"])) 39 { 40 $recordid = $_REQUEST["record"]; 41 $oReport = new Reports($recordid); 42 $BLOCK1 = getPrimaryColumnsHTML($oReport->primodule); 43 $BLOCK1 .= getSecondaryColumnsHTML($oReport->secmodule); 44 $BLOCK2 = $oReport->getSelectedColumnsList($recordid); 45 $report_column->assign("BLOCK1",$BLOCK1); 46 $report_column->assign("BLOCK2",$BLOCK2); 47 }else 48 { 49 $primarymodule = $_REQUEST["primarymodule"]; 50 $secondarymodule = $_REQUEST["secondarymodule"]; 51 $BLOCK1 = getPrimaryColumnsHTML($primarymodule); 52 $BLOCK1 .= getSecondaryColumnsHTML($secondarymodule); 53 $report_column->assign("BLOCK1",$BLOCK1); 54 55 } 56 57 /** Function to formulate the vtiger_fields for the primary modules 58 * This function accepts the module name 59 * as arguments and generates the vtiger_fields for the primary module as 60 * a HTML Combo values 61 */ 62 63 function getPrimaryColumnsHTML($module) 64 { 65 global $ogReport; 66 global $app_list_strings; 67 global $current_language; 68 69 $mod_strings = return_module_language($current_language,$module); 70 foreach($ogReport->module_list[$module] as $key=>$value) 71 { 72 if(isset($ogReport->pri_module_columnslist[$module][$key])) 73 { 74 $shtml .= "<optgroup label=\"".$app_list_strings['moduleList'][$module]." ".$key."\" class=\"select\" style=\"border:none\">"; 75 foreach($ogReport->pri_module_columnslist[$module][$key] as $field=>$fieldlabel) 76 { 77 if(isset($mod_strings[$fieldlabel])) 78 { 79 $shtml .= "<option value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>"; 80 }else 81 { 82 $shtml .= "<option value=\"".$field."\">".$fieldlabel."</option>"; 83 } 84 } 85 } 86 } 87 return $shtml; 88 } 89 90 /** Function to formulate the vtiger_fields for the secondary modules 91 * This function accepts the module name 92 * as arguments and generates the vtiger_fields for the secondary module as 93 * a HTML Combo values 94 */ 95 96 97 function getSecondaryColumnsHTML($module) 98 { 99 global $ogReport; 100 global $app_list_strings; 101 global $current_language; 102 103 if($module != "") 104 { 105 $secmodule = explode(":",$module); 106 for($i=0;$i < count($secmodule) ;$i++) 107 { 108 $mod_strings = return_module_language($current_language,$secmodule[$i]); 109 foreach($ogReport->module_list[$secmodule[$i]] as $key=>$value) 110 { 111 if(isset($ogReport->sec_module_columnslist[$secmodule[$i]][$key])) 112 { 113 $shtml .= "<optgroup label=\"".$app_list_strings['moduleList'][$secmodule[$i]]." ".$key."\" class=\"select\" style=\"border:none\">"; 114 foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$key] as $field=>$fieldlabel) 115 { 116 if(isset($mod_strings[$fieldlabel])) 117 { 118 $shtml .= "<option value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>"; 119 }else 120 { 121 $shtml .= "<option value=\"".$field."\">".$fieldlabel."</option>"; 122 } 123 } 124 } 125 } 126 } 127 } 128 return $shtml; 129 } 130 131 $report_column->display("ReportColumns.tpl"); 132 ?> 133
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |