/* Decoded by unphp.net */ ?>get('sourcemodule'); $tabid = getTabid($module); $query = "SELECT columnname,fieldname,fieldlabel,uitype,presence,displaytype FROM vtiger_field WHERE tabid=? "; $cfquery = $query." and columnname like 'cf_%'"; $standardquery = $query." and columnname not like 'cf_%'"; $cffields = $adb->pquery($cfquery,array($tabid)); $field['cf'] = $this->getVtigerssFieldInfo($cffields); $standardfields = $adb->pquery($standardquery,array($tabid)); $field['standard'] = $this->getVtigerssFieldInfo($standardfields); $response = new Vtiger_Response(); try{ $result = array('Fields'=>$field); $response->setResult($result); }catch(Exception $e) { $response->setError($e->getCode(), $e->getMessage()); } $response->emit(); } public function getVtigerssFieldInfo($cffields){ global $adb; while($record = $adb->fetchByAssoc($cffields)){ $cf['columnname'] = $record['columnname']; $cf['fieldname'] = $record['fieldname']; $cf['fieldlabel'] = $record['fieldlabel']; $name = $this->getUITypeDisplayName($record['uitype']); $cf['uitype'] = $record['uitype']."(".$name.")"; $presence = $record['presence']; switch($presence){ Case 0: $status = "Active"; break; Case 1: $status = "In Active"; break; Case 2: $status = "Active"; break; } $cf['presence'] = $status; $displaytype = $record['displaytype']; switch($displaytype){ Case 1: $type = "Displayed both in Detail view and Edit view"; break; Case 2: $type = "Displayed only in the Detail view"; break; Case 3 : $type = "Displayed only in the List view"; break; } $cf['displaytype'] = $type; $info[] = $cf; } return $info; } public function getUITypeDisplayName($uiType){ global $adb; if($uiType == '69') { $fieldDataType = 'image'; } else if($uiType == '26') { $fieldDataType = 'documentsFolder'; } else if($uiType == '27') { $fieldDataType = 'fileLocationType'; } else if($uiType == '9') { $fieldDataType = 'percentage'; } else if($uiType == '28') { $fieldDataType = 'documentsFileUpload'; } else if($uiType == '83') { $fieldDataType = 'productTax'; } else if($uiType == '117') { $fieldDataType = 'currencyList'; } else if($uiType == '55') { $fieldDataType = 'picklist'; } else if($uiType == '55') { $fieldDataType = 'salutation'; } else if($uiType == '54') { $fieldDataType = 'multiowner'; } else if($uiType == '4') { $fieldDataType = 'System Auto Generated'; }else if($uiType == '5') { $fieldDataType = 'Date'; }else if($uiType == '70') { $fieldDataType = 'System Time'; }else if($uiType == '1' || $uiType == '2') { $fieldDataType = 'Text'; }else if($uiType == '7') { $fieldDataType = 'Decimal'; }else{ $fieldDataType = $adb->query_result($adb->pquery("SELECT fieldtype FROM vtiger_ws_fieldtype WHERE uitype=?",array($uiType)),0,'fieldtype'); } if($fieldDataType == ''){ $fieldDataType = $adb->query_result($adb->pquery("SELECT type FROM vtiger_ws_referencetype WHERE fieldtypeid=?",array($uiType)),0,'type'); } return ucwords($fieldDataType); } public function validateRequest(Vtiger_Request $request) { return $request->validateWriteAccess(); } }