模块开发: Difference between revisions

Line 625: Line 625:
</syntaxhighlight>
</syntaxhighlight>


==执行Dolibarr事件代码 (可选)==
==在Dolibarr事件上触发代码 (可选)==
'''When''': If you want to execute your own code once a common Dolibarr event has occurred (example: I want to update a table in my module when an invoice is created into Dolibarr), you must create a '''triggers'''.
'''何时''':希望在Dolibarr标准操作后触发执行特定操作时(例如:当在Dolibarr中创建发票时,我想更新模块中的表),您需要创建一个 '''triggers''' 文件。


See also [[Interfaces_Dolibarr_toward_foreign_systems]]
另请参阅 [[Interfaces_Dolibarr_toward_foreign_systems|Dolibarr到外部系统的接口]] 和 [[Interfaces_from_foreign_systems_toward_Dolibarr|外部系统到Dolibarr的接口]]
and [[Interfaces_from_foreign_systems_toward_Dolibarr]]


==钩子代码 (可选)==
==在Dolibarr的hooks处插入代码 (可选)==
'''When''': When you want to add code or replace Dolibarr code into another situation than a business event (See previous chapter for adding code during a business event).
'''何时''':当您想更改或添加业务事件以外的代码时(请参阅上一章)。


See page [[Hooks_system]].
请参阅页面 [[Hooks_system|Hooks系统]].




==添加编码规则==
==添加编号模块(可选)==
'''When''': When you need a new rule for generated ref of elements that is not covered by existing rules.
'''何时''':当您想添加默认模块未涵盖的编号规则时。


See page [[Create numbering module]].
请参阅页面 [[Create numbering module|创建编号模块]] 。


==创建文档模板 (optional)==
==添加新文档模板 (可选)==
'''When''': When you want to personalized your own generated PDF or ODT documents.
'''何时''':需要添加新文档模板时。如想要个性化自己生成的 PDF 或 ODT 文档。


Note: To add this feature you don't need to create a module descriptor.
注意:要添加此功能,您无需创建模块描述符文件。


Documentation to add your own template is available on page [[Create_a_PDF_document_template]] or [[Create_an_ODT_document_template]].
有关如何从模板生成文档的详情,请参阅页面 [[Create_a_PDF_document_template|创建PDF文档模板]] 或 [[Create_an_ODT_document_template|创建ODT文档模板]] 。


==创建主题 (optional)==
==添加主题 (可选)==
'''When''': When you want to personalized your colors/fonts/images.
'''何时''':当您想要根据您的情况定制界面(颜色/字体/图形)时。


Note: To add this feature you don't need to create a module descriptor.
注意:要添加此功能,您无需创建模块描述符。


To add your own skin, read page [[Skins]].
请参阅页面 [[Skins|主题]] 。


==修改开发模块作者名==
==修改开发模块作者名==
Line 661: Line 660:


修改以下变量的值以修改作者名称
修改以下变量的值以修改作者名称
<syntaxhighlight lang="PHP">
<syntaxhighlight lang="PHP">
$this->editor_name = 'Roger@QQ:12464313';
$this->editor_name = 'Roger@QQ:12464313';
715

edits