[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 3 /********************************************************************************* 4 ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 5 * ("License"); You may not use this file except in compliance with the License 6 * The Original Code is: vtiger CRM Open Source 7 * The Initial Developer of the Original Code is vtiger. 8 * Portions created by vtiger are Copyright (C) vtiger. 9 * All Rights Reserved. 10 * 11 ********************************************************************************/ 12 13 14 require_once ('include/database/PearDatabase.php'); 15 require_once('themes/'.$theme.'/layout_utils.php'); 16 require_once ('include/utils/UserInfoUtil.php'); 17 require_once ('include/utils/utils.php'); 18 19 global $mod_strings; 20 global $app_strings; 21 global $app_list_strings; 22 23 global $adb; 24 global $theme; 25 $theme_path="themes/".$theme."/"; 26 $image_path=$theme_path."images/"; 27 require_once ($theme_path.'layout_utils.php'); 28 29 30 $field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); 31 $allfields=Array(); 32 foreach($field_module as $fld_module) 33 { 34 $fieldListResult = getDefOrgFieldList($fld_module); 35 $noofrows = $adb->num_rows($fieldListResult); 36 $language_strings = return_module_language($current_language,$fld_module); 37 $allfields[$fld_module] = getStdOutput($fieldListResult, $noofrows, $language_strings,$profileid); 38 } 39 40 if($_REQUEST['fld_module'] != '') 41 $smarty->assign("DEF_MODULE",$_REQUEST['fld_module']); 42 else 43 $smarty->assign("DEF_MODULE",'Leads'); 44 45 /** Function to get the field label/permission array to construct the default orgnization field UI for the specified profile 46 * @param $fieldListResult -- mysql query result that contains the field label and uitype:: Type array 47 * @param $mod_strings -- i18n language mod strings array:: Type array 48 * @param $profileid -- profile id:: Type integer 49 * @returns $standCustFld -- field label/permission array :: Type varchar 50 * 51 */ 52 function getStdOutput($fieldListResult, $noofrows, $lang_strings,$profileid) 53 { 54 global $adb; 55 $standCustFld = Array(); 56 for($i=0; $i<$noofrows; $i++,$row++) 57 { 58 $uitype = $adb->query_result($fieldListResult,$i,"uitype"); 59 $mandatory = ''; 60 $readonly = ''; 61 if($uitype == 2 || $uitype == 6 || $uitype == 22 || $uitype == 73 || $uitype == 24 || $uitype == 81 || $uitype == 50 || $uitype == 23 || $uitype == 16 || $uitype == 20) 62 { 63 $mandatory = '<font color="red">*</font>'; 64 $readonly = 'disabled'; 65 } 66 67 $fieldlabel = $adb->query_result($fieldListResult,$i,"fieldlabel"); 68 if($lang_strings[$fieldlabel] !='') 69 $standCustFld []= $mandatory.' '.$lang_strings[$fieldlabel]; 70 else 71 $standCustFld []= $mandatory.' '.$fieldlabel; 72 if($adb->query_result($fieldListResult,$i,"visible") == 0) 73 { 74 $visible = "checked"; 75 } 76 else 77 { 78 $visible = ""; 79 } 80 $standCustFld []= '<input type="checkbox" name="'.$adb->query_result($fieldListResult,$i,"fieldid").'" '.$visible.' '.$readonly.'>'; 81 82 } 83 $standCustFld=array_chunk($standCustFld,2); 84 $standCustFld=array_chunk($standCustFld,4); 85 return $standCustFld; 86 } 87 88 $smarty->assign("FIELD_INFO",$field_module); 89 $smarty->assign("FIELD_LISTS",$allfields); 90 $smarty->assign("MOD", return_module_language($current_language,'Settings')); 91 $smarty->assign("IMAGE_PATH",$image_path); 92 $smarty->assign("APP", $app_strings); 93 $smarty->assign("CMOD", $mod_strings); 94 $smarty->assign("MODE",'edit'); 95 $smarty->display("FieldAccess.tpl"); 96 97 ?>
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 |