当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Functions::getModuleFieldInfos方法代码示例

本文整理汇总了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);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:49,代码来源:Module.php

示例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;
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:17,代码来源:Deprecated.php


注:本文中的Vtiger_Functions::getModuleFieldInfos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。