[ 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 if(isset($_REQUEST["record"])) 12 { 13 $reportid = $_REQUEST["record"]; 14 $oReport = new Reports($reportid); 15 $oReport->getAdvancedFilterList($reportid); 16 17 $BLOCK1 = getPrimaryColumns_AdvFilterHTML($oReport->primodule,$oReport->advft_column[0]); 18 $BLOCK1 .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule,$oReport->advft_column[0]); 19 $report_std_filter->assign("BLOCK1", $BLOCK1); 20 21 $BLOCK2 = getPrimaryColumns_AdvFilterHTML($oReport->primodule,$oReport->advft_column[1]); 22 $BLOCK2 .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule,$oReport->advft_column[1]); 23 $report_std_filter->assign("BLOCK2", $BLOCK2); 24 25 $BLOCK3 = getPrimaryColumns_AdvFilterHTML($oReport->primodule,$oReport->advft_column[2]); 26 $BLOCK3 .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule,$oReport->advft_column[2]); 27 $report_std_filter->assign("BLOCK3", $BLOCK3); 28 29 $BLOCK4 = getPrimaryColumns_AdvFilterHTML($oReport->primodule,$oReport->advft_column[3]); 30 $BLOCK4 .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule,$oReport->advft_column[3]); 31 $report_std_filter->assign("BLOCK4", $BLOCK4); 32 33 $BLOCK5 = getPrimaryColumns_AdvFilterHTML($oReport->primodule,$oReport->advft_column[4]); 34 $BLOCK5 .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule,$oReport->advft_column[4]); 35 $report_std_filter->assign("BLOCK5", $BLOCK5); 36 37 $FILTEROPTION1 = getAdvCriteriaHTML($oReport->advft_option[0]); 38 $report_std_filter->assign("FOPTION1",$FILTEROPTION1); 39 40 $FILTEROPTION2 = getAdvCriteriaHTML($oReport->advft_option[1]); 41 $report_std_filter->assign("FOPTION2",$FILTEROPTION2); 42 43 $FILTEROPTION3 = getAdvCriteriaHTML($oReport->advft_option[2]); 44 $report_std_filter->assign("FOPTION3",$FILTEROPTION3); 45 46 $FILTEROPTION4 = getAdvCriteriaHTML($oReport->advft_option[3]); 47 $report_std_filter->assign("FOPTION4",$FILTEROPTION4); 48 49 $FILTEROPTION5 = getAdvCriteriaHTML($oReport->advft_option[4]); 50 $report_std_filter->assign("FOPTION5",$FILTEROPTION5); 51 52 $report_std_filter->assign("VALUE1",$oReport->advft_value[0]); 53 $report_std_filter->assign("VALUE2",$oReport->advft_value[1]); 54 $report_std_filter->assign("VALUE3",$oReport->advft_value[2]); 55 $report_std_filter->assign("VALUE4",$oReport->advft_value[3]); 56 $report_std_filter->assign("VALUE5",$oReport->advft_value[4]); 57 58 }else 59 { 60 $primarymodule = $_REQUEST["primarymodule"]; 61 $secondarymodule = $_REQUEST["secondarymodule"]; 62 $BLOCK1 = getPrimaryColumns_AdvFilterHTML($primarymodule); 63 $BLOCK1 .= getSecondaryColumns_AdvFilterHTML($secondarymodule); 64 $report_std_filter->assign("BLOCK1", $BLOCK1); 65 $report_std_filter->assign("BLOCK2", $BLOCK1); 66 $report_std_filter->assign("BLOCK3", $BLOCK1); 67 $report_std_filter->assign("BLOCK4", $BLOCK1); 68 $report_std_filter->assign("BLOCK5", $BLOCK1); 69 70 } 71 72 /** Function to get primary columns for an advanced filter 73 * This function accepts The module as an argument 74 * This generate columns of the primary modules for the advanced filter 75 * It returns a HTML string of combo values 76 */ 77 78 function getPrimaryColumns_AdvFilterHTML($module,$selected="") 79 { 80 global $ogReport; 81 global $app_list_strings; 82 global $current_language; 83 $mod_strings = return_module_language($current_language,$module); 84 foreach($ogReport->module_list[$module] as $key=>$value) 85 { 86 $shtml .= "<optgroup label=\"".$app_list_strings['moduleList'][$module]." ".$key."\" class=\"select\" style=\"border:none\">"; 87 if(isset($ogReport->pri_module_columnslist[$module][$key])) 88 { 89 foreach($ogReport->pri_module_columnslist[$module][$key] as $field=>$fieldlabel) 90 { 91 if(isset($mod_strings[$fieldlabel])) 92 { 93 if($selected == $field) 94 { 95 $shtml .= "<option selected value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>"; 96 }else 97 { 98 $shtml .= "<option value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>"; 99 } 100 }else 101 { 102 if($selected == $field) 103 { 104 $shtml .= "<option selected value=\"".$field."\">".$fieldlabel."</option>"; 105 }else 106 { 107 $shtml .= "<option value=\"".$field."\">".$fieldlabel."</option>"; 108 } 109 } 110 } 111 } 112 } 113 return $shtml; 114 } 115 116 117 118 /** Function to get Secondary columns for an advanced filter 119 * This function accepts The module as an argument 120 * This generate columns of the secondary module for the advanced filter 121 * It returns a HTML string of combo values 122 */ 123 124 function getSecondaryColumns_AdvFilterHTML($module,$selected="") 125 { 126 global $ogReport; 127 global $app_list_strings; 128 global $current_language; 129 130 if($module != "") 131 { 132 $secmodule = explode(":",$module); 133 for($i=0;$i < count($secmodule) ;$i++) 134 { 135 $mod_strings = return_module_language($current_language,$secmodule[$i]); 136 foreach($ogReport->module_list[$secmodule[$i]] as $key=>$value) 137 { 138 $shtml .= "<optgroup label=\"".$app_list_strings['moduleList'][$secmodule[$i]]." ".$key."\" class=\"select\" style=\"border:none\">"; 139 if(isset($ogReport->sec_module_columnslist[$secmodule[$i]][$key])) 140 { 141 foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$key] as $field=>$fieldlabel) 142 { 143 if(isset($mod_strings[$fieldlable])) 144 { 145 if($selected == $field) 146 { 147 $shtml .= "<option selected value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>"; 148 }else 149 { 150 $shtml .= "<option value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>"; 151 } 152 }else 153 { 154 if($selected == $field) 155 { 156 $shtml .= "<option selected value=\"".$field."\">".$fieldlabel."</option>"; 157 }else 158 { 159 $shtml .= "<option value=\"".$field."\">".$fieldlabel."</option>"; 160 } 161 } 162 } 163 } 164 } 165 } 166 } 167 return $shtml; 168 } 169 170 171 /** Function to get the advanced filter criteria for an option 172 * This function accepts The option in the advenced filter as an argument 173 * This generate filter criteria for the advanced filter 174 * It returns a HTML string of combo values 175 */ 176 177 178 function getAdvCriteriaHTML($selected="") 179 { 180 global $adv_filter_options; 181 182 foreach($adv_filter_options as $key=>$value) 183 { 184 if($selected == $key) 185 { 186 $shtml .= "<option selected value=\"".$key."\">".$value."</option>"; 187 }else 188 { 189 $shtml .= "<option value=\"".$key."\">".$value."</option>"; 190 } 191 } 192 193 return $shtml; 194 } 195 196 ?> 197
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 |