本文整理汇总了PHP中Vtiger_Functions::getModuleFieldInfos方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::getModuleFieldInfos方法的具体用法?PHP Vtiger_Functions::getModuleFieldInfos怎么用?PHP Vtiger_Functions::getModuleFieldInfos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::getModuleFieldInfos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UpdateLabels
public function UpdateLabels($params)
{
$adb = PearDatabase::getInstance();
$tabid = (int) $params['tabid'];
$modulesEntity = self::getModulesEntity($tabid);
$moduleEntity = $modulesEntity[$tabid];
$modulename = $moduleEntity['modulename'];
$tablename = $moduleEntity['tablename'];
$entityidfield = $moduleEntity['entityidfield'];
$fieldname = $moduleEntity['fieldname'];
$searchcolumn = $moduleEntity['searchcolumn'];
$moduleInfo = Vtiger_Functions::getModuleFieldInfos($modulename);
$columns_name = explode(',', $fieldname);
$columns_search = explode(',', $searchcolumn);
$sql_ext = '';
$sql_fieldname = '';
$sql_searchcolumn = '';
$moduleInfoExtend = [];
foreach ($moduleInfo as $field => $fieldInfo) {
$moduleInfoExtend[$fieldInfo['columnname']] = $fieldInfo;
}
foreach ($columns_name as $key => $columnName) {
$fieldObiect = $moduleInfoExtend[$columnName];
if (in_array($fieldObiect['uitype'], array(10, 51, 75, 81))) {
$sql_ext .= " LEFT JOIN (SELECT extj_{$key}.crmid, extj_{$key}.label AS ext_{$columnName} FROM vtiger_crmentity extj_{$key}) ext_{$key} ON ext_{$key}.crmid = " . $fieldObiect['tablename'] . ".{$columnName}";
$sql_fieldname .= ",ext_{$columnName}";
} else {
$sql_fieldname .= ",{$columnName}";
}
}
foreach ($columns_search as $key => $columnName) {
$fieldObiect = $moduleInfoExtend[$columnName];
if (in_array($fieldObiect['uitype'], array(10, 51, 75, 81))) {
$sql_ext2 = " LEFT JOIN (SELECT extj_{$key}.crmid, extj_{$key}.label AS ext_{$columnName} FROM vtiger_crmentity extj_{$key}) ext_{$key} ON ext_{$key}.crmid = " . $fieldObiect['tablename'] . ".{$columnName}";
if (!strstr($sql_ext, $sql_ext2)) {
$sql_ext .= $sql_ext2;
}
$sql_searchcolumn .= ",ext_{$columnName}";
} else {
$sql_searchcolumn .= ",{$columnName}";
}
}
$sql = "UPDATE vtiger_crmentity";
$sql .= " LEFT JOIN {$tablename} ON vtiger_crmentity.crmid = {$tablename}.{$entityidfield} ";
$sql .= $sql_ext;
$sql .= " SET vtiger_crmentity.label = CONCAT_WS(' ' {$sql_fieldname}), vtiger_crmentity.searchlabel = CONCAT_WS(' ' {$sql_searchcolumn})";
$sql .= " WHERE vtiger_crmentity.setype = '{$modulename}'";
$adb->query($sql);
}
示例2: getModuleFieldTypeOfDataInfos
static function getModuleFieldTypeOfDataInfos($tables, $tabid = '')
{
$result = array();
if (!empty($tabid)) {
$module = Vtiger_Functions::getModuleName($tabid);
$fieldInfos = Vtiger_Functions::getModuleFieldInfos($tabid);
foreach ($fieldInfos as $name => $field) {
if (($field['displaytype'] == '1' || $field['displaytype'] == '3') && ($field['presence'] == '0' || $field['presence'] == '2')) {
$label = Vtiger_Functions::getTranslatedString($field['fieldlabel'], $module);
$result[$name] = array($label => $field['typeofdata']);
}
}
} else {
throw new Exception('Field lookup by table no longer supported');
}
return $result;
}