Difference between revisions of "Module ModuleBuilder"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
(Created page with "{{Template用户手册}} {{Template开发文档}} {{TemplateMainPageZh}}<br /> =Activation of ModuleBuilder= 从Dolibarr 10.0.0 开始,可以使用ModuleBuilder创建模块...")
 
m
Tag: 2017 source edit
Line 1: Line 1:
{{Template用户手册}} {{Template开发文档}} {{TemplateMainPageZh}}<br />
+
<!-- BEGIN origin interlang links -->
=Activation of ModuleBuilder=
+
<!-- You can edit this section but do NOT remove these comments
从Dolibarr 10.0.0 开始,可以使用ModuleBuilder创建模块,为激活ModuleBuilder,按以下步骤:
+
    Links below will be automatically replicated on translated pages by PolyglotBot -->
 +
[[fr:Module_Adhérents]]
 +
[[es:Módulo_Miembros]]
 +
[[de:Modul_Mitglieder]]
 +
<!-- END interlang links -->
  
*在'''主页-设置-模块'''中激活 ModuleBuilder.
+
[[Category:Foundations]]
 +
{{TemplateDocUser}}
 +
{{TemplateModEN}}
 +
{{BasculeDevUserEn|
 +
name=Foundations|
 +
num=310|
 +
devdoc=|
 +
userdoc=This page|}}
  
[[File:激活modulebuilder.png|800px]]
+
= Introduction =
 +
The ModuleBuilder is a module for developpers only, to help you to develop a module.
 +
It is RAD, No Code or Low Code tool.
  
*点击右上角的‘Bug’图标开始使用(或者在浏览器中输入'yourhost/modulebuilder')
+
= Installation =
 +
{{NoInstallModuleEn}}
  
[[File:Buglogo.png]]
+
= Configuration =
 +
{{ActivationModuleEn}}
  
*运行的ModuleBuilder界面如下:
+
= Usage =
 
 
[[File:Modulebuilder.png|800px]]
 
=使用ModuleBuilder创建主模块文件=
 
在下图‘模块名’处填入模块名,然后点击右侧的‘创建’按键,完成创建模块主文件。
 
 
 
*改变模块ID值: $this->numero = 100000(将此100000变更为你为模块设置的ID值)。为了避免与其他模块发生冲突,您可以查阅列出已保留ID号的页面: [[List of modules id|List of modules id]].
 
*修改构造函数中定义的其他变量 (参考[[主模块代码框架]]中的注释内容).
 
*您的模块主文件已准备就绪。
 
 
 
[[file:模块名.png|800px]]
 
=使用ModuleBuilder生成PHP DAO类文件=
 
 
 
*使用ModuleBuilder生成PHP DAO类文件,简单至在下图中选对'对象'选项卡,输入'对象名',然后点击创建,即可生成相关一切文档。
 
 
 
[[File:新对象.png|800px]]
 
 
 
*创建完成后,仍可继续创建受模块管理的其他“对象”
 
*“对象”选顶卡的界面如下:
 
 
 
[[file:myObject.png|800px]]
 
 
 
如图所示,ModuleBuilder自动帮我们建好了以下文件:
 
* PHP DAO CRUD类的文件 : '''mymodule/class/myobject.class.php '''
 
* PHP API类的文件 : '''mymodule/class/api_mymodule.class.php'''
 
* PHP单元测试类的文件 : '''mymodule/test/phpunit/MyObjectTest.php'''
 
 
 
* PHP库的文件 : '''mymodule/lib/myobject.lib.php'''
 
* Image : '''mymodule/img/object_myobject.png'''
 
 
 
* Sql文件 : '''mymodule/sql/llx_mymodule_myobject.sql'''
 
* Sql文件用于附加字段 : '''mymodule/sql/llx_mymodule_myobject_extrafields.sql '''
 
* Sql文件(创建索引) : '''mymodule/sql/llx_mymodule_myobject.key.sql'''
 
 
 
* 用于显示记录列表的PHP页面 : '''mymodule/myobject_list.php'''
 
* 用于创建/编辑/查看记录的PHP页面 : '''mymodule/myobject_card.php?action=create(mymodule/myobject_card.php)'''
 
* 事件选项卡的PHP页面 : '''mymodule/myobject_agenda.php '''
 
* 文档选项卡的PHP页面 : '''mymodule/myobject_document.php '''
 
* 注释选项卡的PHP页面 : '''mymodule/myobject_note.php'''
 
 
 
* ScriptFile : '''mymodule/scripts/myobject.php '''
 
点击每一条右侧的图标,即可以MB中编辑该文件,按下方保存按键保存。
 
 
 
另有“重新生成类文件和SQL文件”“生成丢失文件”两按键可以使用。
 
 
 
“对象”选项卡的最下方,就是对象包含的字段。每行一个字段,可以增加名删除字段。
 
 
 
[[File:MBobject字段.png|800px]]
 
=为模块添加语言文件=
 
打开ModuleBuilder,选中模块。
 
 
 
选中"语言",在语言框中选择"zh_CN - 中文",然后点击添加语言文件。 如图: [[File:创建语言文件.png]]
 

Revision as of 12:12, 19 February 2021

Foundations
Numero/ID of module 310
User doc. of module This page
Developer doc. of module

Introduction

The ModuleBuilder is a module for developpers only, to help you to develop a module. It is RAD, No Code or Low Code tool.

Installation

This module is included with the Dolibarr distribution, so there is no need to install it.

Configuration

To use this module, you must first enable it using an administrator account, via the menu option "Home - Setup - Modules".

Choose the tab where the module is listed. Then click on "Activate".

The module is now activated.

If a cog icon appears Cog circle.svg on module thumb or at end of the line of the module, click on it to access the setup page specific to the module.

Usage