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


PHP Vtiger_Module::createFiles方法代码示例

本文整理汇总了PHP中Vtiger_Module::createFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Module::createFiles方法的具体用法?PHP Vtiger_Module::createFiles怎么用?PHP Vtiger_Module::createFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Module的用法示例。


在下文中一共展示了Vtiger_Module::createFiles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createModule

 public static function createModule($moduleInformation)
 {
     $moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));
     $module = new Vtiger_Module();
     $module->name = ucfirst($moduleInformation['module_name']);
     $module->label = $moduleInformation['module_label'];
     $module->save();
     $module->initTables();
     $block = new Vtiger_Block();
     $block->label = 'LBL_' . strtoupper($module->name) . '_INFORMATION';
     $module->addBlock($block);
     $blockcf = new Vtiger_Block();
     $blockcf->label = 'LBL_CUSTOM_INFORMATION';
     $module->addBlock($blockcf);
     $field1 = new Vtiger_Field();
     $field1->name = $moduleInformation['entityfieldname'];
     $field1->label = $moduleInformation['entityfieldlabel'];
     $field1->uitype = 2;
     $field1->column = $field1->name;
     $field1->columntype = 'VARCHAR(255)';
     $field1->typeofdata = 'V~M';
     $block->addField($field1);
     $module->setEntityIdentifier($field1);
     /** Common fields that should be in every module, linked to vtiger CRM core table */
     $field2 = new Vtiger_Field();
     $field2->name = 'assigned_user_id';
     $field2->label = 'Assigned To';
     $field2->table = 'vtiger_crmentity';
     $field2->column = 'smownerid';
     $field2->uitype = 53;
     $field2->typeofdata = 'V~M';
     $block->addField($field2);
     $field3 = new Vtiger_Field();
     $field3->name = 'createdtime';
     $field3->label = 'Created Time';
     $field3->table = 'vtiger_crmentity';
     $field3->column = 'createdtime';
     $field3->uitype = 70;
     $field3->typeofdata = 'DT~O';
     $field3->displaytype = 2;
     $block->addField($field3);
     $field4 = new Vtiger_Field();
     $field4->name = 'modifiedtime';
     $field4->label = 'Modified Time';
     $field4->table = 'vtiger_crmentity';
     $field4->column = 'modifiedtime';
     $field4->uitype = 70;
     $field4->typeofdata = 'DT~O';
     $field4->displaytype = 2;
     $block->addField($field4);
     // Create default custom filter (mandatory)
     $filter1 = new Vtiger_Filter();
     $filter1->name = 'All';
     $filter1->isdefault = true;
     $module->addFilter($filter1);
     // Add fields to the filter created
     $filter1->addField($field1)->addField($field2, 1)->addField($field3, 2);
     // Set sharing access of this module
     $module->setDefaultSharing();
     // Enable and Disable available tools
     $module->enableTools(array('Import', 'Export', 'Merge'));
     // Initialize Webservice support
     $module->initWebservice();
     // Create files
     $module->createFiles($field1);
 }
开发者ID:krzychab,项目名称:YetiForceCRM,代码行数:66,代码来源:Module.php


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