'; //echo get_form_header("Standard Fields", "", false ); global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); $fld_module = $_REQUEST["fld_module"]; //Retreiving the custom picklist field array $usrFldArray = getUserFldArray($fld_module); $xtpl=new XTemplate ('modules/Settings/ComboFieldList.html'); if($fld_module == 'Leads') { $custFldArray = Array ($mod_strings['LBL_LEAD_SOURCE']=>'leadsource' ,$mod_strings['LBL_SALUTATION']=>'salutationtype' ,$mod_strings['LBL_LEAD_STATUS']=>'leadstatus' ,$mod_strings['LBL_INDUSTRY']=>'industry' ,$mod_strings['LBL_RATING']=>'rating'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Accounts') { $custFldArray = Array($mod_strings['LBL_ACCOUNT_TYPE']=>'accounttype' ,$mod_strings['LBL_INDUSTRY']=>'industry'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Contacts') { $custFldArray = Array($mod_strings['LBL_SALUTATION']=>'salutationtype' ,$mod_strings['LBL_LEAD_SOURCE']=>'leadsource'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Potentials') { $custFldArray = Array($mod_strings['LBL_LEAD_SOURCE']=>'leadsource' ,$mod_strings['LBL_BUSINESS_TYPE']=>'opportunity_type' ,$mod_strings['LBL_CURRENCY_TYPE']=>'currency' ,$mod_strings['LBL_SALES_STAGE']=>'sales_stage'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'HelpDesk') { $custFldArray = Array($mod_strings['LBL_PRIORITY']=>'ticketpriorities' ,$mod_strings['LBL_SEVERITY']=>'ticketseverities' ,$mod_strings['LBL_STATUS']=>'ticketstatus' ,$mod_strings['LBL_CATEGORY']=>'ticketcategories' ,$mod_strings['LBL_FAQ_CATEGORY']=>'faqcategories'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Products') { $custFldArray = Array($mod_strings['LBL_MANUFACTURER']=>'manufacturer' ,$mod_strings['LBL_PRODUCT_CATEGORY']=>'productcategory' ,$mod_strings['LBL_USAGEUNIT']=>'usageunit' ,$mod_strings['LBL_TAXCLASS']=>'taxclass' ,$mod_strings['LBL_GLACCT']=>'glacct' ); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Events') { $custFldArray = Array($mod_strings['LBL_STATUS']=>'eventstatus' ); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Activities') { $custFldArray = Array($mod_strings['LBL_STATUS']=>'taskstatus' ,$mod_strings['LBL_PRIORITY']=>'taskpriority'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Rss') { $custFldArray = Array($mod_strings['LBL_RSS_CATEGORY']=>'rsscategory'); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Vendor') { $custFldArray = Array($mod_strings['LBL_GLACCT']=>'glacct' ); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Quotes') { $custFldArray = Array($mod_strings['LBL_QUOTE_STAGE']=>'quotestage' ,$mod_strings['LBL_CARRIER']=>'carrier' ); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'Orders') { $custFldArray = Array($mod_strings['LBL_CARRIER']=>'carrier' ); $standCustFld = getStdOutput($custFldArray, $mod_strings); } elseif($fld_module == 'SalesOrder') { $custFldArray = Array($mod_strings['LBL_CARRIER']=>'carrier' ); $standCustFld = getStdOutput($custFldArray, $mod_strings); } function fetchTabIDVal($fldmodule) { global $adb; $query = "select tabid from tab where tablabel='" .$fldmodule ."'"; $tabidresult = $adb->query($query); return $adb->query_result($tabidresult,0,"tabid"); } $tabid = fetchTabIDVal($fldmodule); //Standard PickList Fields function getStdOutput($custFldArray, $mod_strings) { $standCustFld = ''; $standCustFld .= '
'; $standCustFld .= get_form_header($mod_strings['LBL_STANDARD_FIELDS'], "", false ); $standCustFld .= '
'; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $i=1; foreach($custFldArray as $custFldName => $custFldTableName) { if ($i%2==0) { $trowclass = 'evenListRow'; } else { $trowclass = 'oddListRow'; } $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $i++; } $standCustFld .='
Operation
'.$mod_strings['FieldName'].'
'.$mod_strings['Edit'].'
'.$custFldName.'
'; return $standCustFld; } $xtpl->assign("MOD", $mod_strings); $xtpl->assign("STANDARD_COMBO_FIELDS", $standCustFld); if($fld_module != 'Activities' && $fld_module != 'Events' && $fld_module != 'Rss') { //Custom PickList Fields $userCustFld =''; $i=1; foreach($usrFldArray as $custFldName => $custFldColName) { if ($i%2==0) { $trowclass = 'evenListRow'; } else { $trowclass = 'oddListRow'; } $custFldTableName = $fld_module.'_'.$custFldColName; $userCustFld .= ''; $userCustFld .= ''.$mod_strings['Edit'].''; $userCustFld .= ''.$custFldName.''; $i++; } $cust_fld_header = get_form_header($mod_strings['CustomFields'], "", false ); $xtpl->assign("CUSTOMHEADER", $cust_fld_header); $custom_combo_table_header = '
Operation
'.$mod_strings['FieldName'].' '; $xtpl->assign("CUSTOM_COMBO_HEADER",$custom_combo_table_header); $xtpl->assign("CUSTOM_COMBO_FIELDS", $userCustFld); } $xtpl->parse("main"); $xtpl->out("main"); function getUserFldArray($fld_module) { $user_fld = Array(); $query = "select * from field where generatedtype=2 and tabid=".fetchTabIDVal($fld_module)." and uitype IN (15,16)"; // echo $query; $result = mysql_query($query); $noofrows = mysql_num_rows($result); if($noofrows > 0) { for($i=0; $i<$noofrows; $i++) { $user_fld[mysql_result($result,$i,"fieldlabel")] = mysql_result($result,$i,"columnname"); } } return $user_fld; } ?>