php - 向 SuiteCRM 添加新模块

标签 php module sugarcrm suitecrm

我正在尝试实用地创建一个新模块,但是 metadata 没有被调用或显示,这是怎么做的:

CRM/Modules/ 中,我在其中添加了 Vendors 文件夹 我添加了以下文件夹:

元数据 , views 文件夹

views => view.list.php

class VendorsViewList extends SugarView
{

}

元数据 => listviewdefs.php

$listViewDefs['Vendors'] = array(
    'NAME' => array(
        'width'   => '30',
        'label'   => 'LBL_LIST_OPPORTUNITY_NAME',
        'link'    => true,
        'default' => true),
    'SALES_STAGE' => array(
        'width'   => '10',
        'label'   => 'LBL_LIST_SALES_STAGE',
        'default' => true),
    'AMOUNT_USDOLLAR' => array(
        'width'   => '10',
        'label'   => 'LBL_LIST_AMOUNT_USDOLLAR',
        'align'   => 'right',
        'default' => true,
        'currency_format' => true,
    ),
    'OPPORTUNITY_TYPE' => array(
        'width' => '15',
        'label' => 'LBL_TYPE'),
    'LEAD_SOURCE' => array(
        'width' => '15',
        'label' => 'LBL_LEAD_SOURCE'),
    'NEXT_STEP' => array(
        'width' => '10',
        'label' => 'LBL_NEXT_STEP'),
    'PROBABILITY' => array(
        'width' => '10',
        'label' => 'LBL_PROBABILITY'),
    'DATE_CLOSED' => array(
        'width' => '10',
        'label' => 'LBL_LIST_DATE_CLOSED',
        'default' => true),
    'CREATED_BY_NAME' => array(
        'width' => '10',
        'label' => 'LBL_CREATED'),
    'ASSIGNED_USER_NAME' => array(
        'width' => '5',
        'label' => 'LBL_LIST_ASSIGNED_USER',
        'module' => 'Employees',
        'id' => 'ASSIGNED_USER_ID',
        'default' => true),
    'MODIFIED_BY_NAME' => array(
        'width' => '5',
        'label' => 'LBL_MODIFIED'),
    'DATE_ENTERED' => array(
        'width' => '10',
        'label' => 'LBL_DATE_ENTERED',
        'default' => true)
);

并且在 metafiles.php

 $metafiles['Vendors'] = array(

    'listviewdefs'    =>    'modules/Vendors/metadata/listviewdefs.php',


 );

在主模块文件夹中我有 Controller : Vendor.php

require_once('include/MVC/Controller/SugarController.php');

class Vendors extends SugarController
{
    function __construct()
    {
        parent::__construct();
    }
}

我看不出这里缺少什么,它调用了 controllerview,但没有调用 metadata

最佳答案

我建议您使用模块构建器来创建模块。如果您选择发布,模块构建器将提供一个 zip 文件,其中包含开始所需的最低限度。

然后您可以从那里自定义模块。

模块构建器为您设置了很多。它:

  • 在 include/modules.php 中注册模块
  • 创建 SugarBean(模型)
  • 创建数据库 vardefs
  • 创建元数据( View )
  • 创建语言文件。
  • 等等...

还有

包的 SugarModules 中的布局与 CRM 的布局相匹配。

如果您正在 SuiteCRM 中编辑模块。请记住,您必须运行修复和重建以清除所有缓存文件。

关于php - 向 SuiteCRM 添加新模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39226881/

相关文章:

clojure - 包 vs 命名空间 vs 模块

Netbeans 中的 Python 引用外部模块

python - SugarCRM 过滤器 PYTHON

javascript - 如何使用Javascript登录SugarCRM?

limit - 更改 SugarCRM 7 中特定子面板中显示的最大记录数

php - 数据映射器,仅用于CRUD操作?

php - 在 While 循环中排序记录

php - 使用base64_encode方法和jquery上传图像时显示进度条

php - 显示 1 而不是全部 out 数据库

module - Rust 无法将 Singleton 从全局空间导入另一个文件中的另一个模块