モジュール 開発: Difference between revisions

m
no edit summary
(見出し翻訳)
mNo edit summary
Line 43: Line 43:


=テンプレート外部モジュールの例=
=テンプレート外部モジュールの例=
A good model to start development of external module can be found here : [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template GitHub Dolibarr Module Modèle]
外部モジュールの開発を開始するのによいお手本は、ここで見つかるだろう : [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template GitHub Dolibarr Module Modèle]


=自前モジュールを作る=
=自前モジュールを作る=
==自前モジュールに関するモジュール説明(Module descriptor)を作る (必須)==
==自前モジュールに関するモジュール説明(Module descriptor)を作る (必須)==
'''When it is required''': Required as soon as an addon is developed, whatever its goal is (except for adding a skin).
'''必須となる時期''': アドオンを開発すると早急に必要、たとえゴールが何であれ (例外はスキンの追加).


'''Since Dolibarr 9.0, you should use the ModuleBuilder module provided as a standard module to generate the module descriptor'''
'''Dolibarr 9.0 から, モジュールビルダ (ModuleBuilder) モジュールを使用すべきだ、モジュール説明を生成するための標準モデルとして使える'''


===Create your module descriptor===
===自前のモジュール説明 (module descriptor) を作成する===
The first step is to create a file descriptor for the module.  
最初のステップは、モジュールに対するファイル説明 (file descriptor) を作成すること.  


*Create directory '''/htdocs/custom/''mymodule''/core/modules''' (for an external module) or '''/htdocs/''mymodule''/core/modules''' if you plan to have this module an official core module of Dolibarr. Then copy the file modMyModule.class.php from the directory '''htdocs/modulebuilder/template''' into this directory. Change the name of the file modMyModule.class.php to the name corresponding to the purpose of your module. Name of the file must start with initial 'mod' and end with .class.php (for example if you want to give the name 'NewName' to this file, then the name should be 'modNewName.class.php').
*ディレクトリ作成: '''/htdocs/custom/''mymodule''/core/modules''' (外部モジュール向け) または '''/htdocs/''mymodule''/core/modules''' 、 Dolibarr の公式コアモジュール (official core module) とする場合は. 次にファイル modMyModule.class.php をディレクトリ '''htdocs/modulebuilder/template''' からコピーして上記のディレクトリに作成する. ファイルの名称を modMyModule.class.php から 自前モジュールの目的に合致した名称に変える. ファイル名は、先頭に 'mod' があり、最後が .class.php で終わる (例えば、ファイル名を '新名' にするなら, 'mod新名.class.php' となる).


Next modify the contents of this file as follows:
次は、ファイルの内容を以下のように変える:


*Replace all "modMyModule" with a value which corresponds to the purpose of your module. This value must always start with 'mod' and contain only alpha characters (again, if the name given to the file was 'NewName', then replace all "modMyModule" with "modNewName").
*Replace all "modMyModule" with a value which corresponds to the purpose of your module. This value must always start with 'mod' and contain only alpha characters (again, if the name given to the file was 'NewName', then replace all "modMyModule" with "modNewName").
Line 64: Line 64:
Your file descriptor for your module is ready. See the next step to activate it.
Your file descriptor for your module is ready. See the next step to activate it.


===Test your descriptor===
===自前の説明をテストする===


Launch Dolibarr and go to page '''Setup->module'''?  
Launch Dolibarr and go to page '''Setup->module'''?  
Line 70: Line 70:


==新規モジュールファイルに関するパスツリー (必須)==
==新規モジュールファイルに関するパスツリー (必須)==
This is how your files must be organized when building a new module (the zip file must also match this rule).
これは、新しいモジュールを構築する際に、ファイルをどう整理するかを示している (ZIPファイルもこのルールに合わせる必要あり).
Note: Only the second line is mandatory.
注:2行目だけが必須.


{{TemplateModuleTreeSimple}}
{{TemplateModuleTreeSimple}}
56

edits