将新模块添加到SuiteCRM

I'm trying to create a new Module pragmatically, but the metadata is not being called or showed , here how am doing it :

in CRM/Modules/ I added Vendors folder inside of it I added the follwoing folders :

metadata , views folders

in views => view.list.php

class VendorsViewList extends SugarView
{

}

and in metadata => 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)
);

and in metafiles.php

 $metafiles['Vendors'] = array(

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


 );

and in the main module folder I have the controller : Vendor.php

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

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

I can't see what am missing here , it's calling the controller and the view , but not the metadata

I would recommend that you use module builder to create modules. If you select publish, module builder will give a zip file with the minimum needed to get started.

You can then customise the module from there.

Module builder sets up quite a lot for you. It:

  • registering the module in include/modules.php
  • creating the SugarBean (Model)
  • creating the database vardefs
  • creating metadata (views)
  • creating language files.
  • And so on...

Also

The layout in the SugarModules of a package matches the layout of the CRM.

If you are editing a module in SuiteCRM. Remember that you must run a repair and rebuild to clear out any cached files.