モジュール 開発: Difference between revisions

Jump to navigation Jump to search
m
mNo edit summary
Line 54: Line 54:
最初のステップは、モジュールに対するファイル説明 (file descriptor) を作成すること.  
最初のステップは、モジュールに対するファイル説明 (file descriptor) を作成すること.  


*ディレクトリ作成: '''/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' となる).
*ディレクトリ作成: '''/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' となる).


次は、ファイルの内容を以下のように変える:
次は、ファイルの内容を以下のように変更:


*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").
*すべての "modMyModule" をモジュールの目的に合致した値に置換. この値は必ず 'mod' で始まりアルファベットのみで構成 (繰り返すが, もしファイルに付けた名称が 'NewName' なら, すべての "modMyModule" を "modNewName" で置換).
*Change the number in: $this->numero = 100000 by a number that designates your module id. To avoid conflicts with other modules, you can consult the page that lists already reserved id numbers: [[List of modules id|List of modules id]].
*番号を変更: $this->numero = 100000 の部分で、自前モジュールIDを指定する値に. 他のモジュールとの競合を避けるため、すでに予約されているid番号の一覧ページを参考にできる: [[List of modules id|List of modules id]].
*Modify any other variables defined in the constructor (see comment in the code skeleton for their meaning).
*コンストラクタで定義されたその他の変数(意味についてはコード雛形のコメントを参照)を変更.


Your file descriptor for your module is ready. See the next step to activate it.
自前モジュールのファイルディスクリプタの準備ができた。有効化するには次ステップを参照.


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


Launch Dolibarr and go to page '''Setup->module'''?  
Dolibarrを起動し、'''設定->モジュール (Setup->module'''?) ページを表示.
If you set the property version in the module description you should see a new line with your new module and the possibility to activate it or not. If you set the property version to "develop" or "experiental", to see your module, you must first go into '''Setup-Others''' and set MAIN_FEATURES_LEVEL to 1 to see "experimental" modules or 2 to see "development" modules.
モジュール説明でプロパティバージョン (property version) を設定すると、自前の新規モジュールを載せた新規行とそれを有効化するかどうかの選択が表示されるはず. プロパティバージョンを "develop" または "experimental" に設定した場合、自前モジュールを見るには、まず '''設定->その他 (Setup-Others)''' に行き、 MAIN_FEATURES_LEVEL を 1 に設定してから "experimental" モジュールを見るか、2にして から "development" モジュールを見るかする必要がある.


==新規モジュールファイルに関するパスツリー (必須)==
==新規モジュールファイルに関するパスツリー (必須)==
56

edits

Navigation menu