|
8 years ago | |
---|---|---|
.. | ||
skeletons | 8 years ago | |
template | 8 years ago | |
README.md | 8 years ago | |
index.php | 8 years ago |
This is a full featured module template for Dolibarr. It's a tool for module developers to kickstart their project and give an hands-on sample of which features Dolibarr has to offer for module development.
If you're not a module developer you have no use for this.
Dolibarr uses Transifex to manage it's translations.
This template also contains a sample configuration for Transifex managed translations under the hidden .tx directory.
For more informations, see the translator's documentation.
There is a Transifex project for this module.
Make sure Dolibarr (>= 3.3.x) is already installed and configured on your workstation or development server.
In your Dolibarr installation directory, edit the htdocs/conf/conf.php
file
Find the following lines:
//$dolibarr_main_url_root_alt ...
//$dolibarr_main_document_root_alt ...
//
) and assign a sensible value according to your Dolibarr installationFor example :
UNIX:
$dolibarr_main_url_root = 'http://localhost/Dolibarr/htdocs';
$dolibarr_main_document_root = '/var/www/Dolibarr/htdocs';
$dolibarr_main_url_root_alt = '/custom';
$dolibarr_main_document_root_alt = '/var/www/Dolibarr/htdocs/custom';
php
$dolibarr_main_url_root = 'http://localhost/Dolibarr/htdocs';
$dolibarr_main_document_root = 'C:/My Web Sites/Dolibarr/htdocs';
$dolibarr_main_url_root_alt = '/custom';
$dolibarr_main_document_root_alt = 'C:/My Web Sites/Dolibarr/htdocs/custom';
For more information about the conf.php
file take a look at the conf.php.example file.
Note that for Dolibarr versions before 3.5, the $dolibarr_main_url_root_alt
has to be an absolute path
$dolibarr_main_document_root_alt/mymodule
(You may have to create the htdocs/custom
directory first if it doesn't exist yet.)
git clone git@github.com:Dolibarr/dolibarr-module-template.git mymodule
Install Composer dependencies:
composer install
Follow the final steps.
Require this repository from Dolibarr's composer:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/dolibarr/dolibarr-module-template"
}
],
"require": {
"dolibarr/mymodule": "dev-master"
}
}
Run
composer update
Follow the final steps.
From your browser:
MAIN_FEATURES_LEVEL
to 2
A script allows you to rename most of the code to your own module name.
It requires find
, sed
and rename
commands on your system.
Just make sure you provide a CamelCase name.
./dev/newmodule.sh [NewName]
Some work still has to be done manually:
Start a new GIT history
git checkout --orphan [new_branch_name]
Build an awesome module ;)
Only the main commands are listed here.
See the composer comments or the composer.json itself for more informations.
Run a linter, a PHP compatibility version checker and checks coding style.
composer check
Run unit and functional tests.
composer test
Build code and user documentation.
Run the checks and tests then build a distribution ZIP.
composer release
Optional GIT hooks are provided.
These are just wrappers calling composer scripts.
They ensure best practices are followed during module development.
Install:
composer git_hooks_install
Remove:
composer git_hooks_remove
The de-facto standard for publishing and marketing modules for Dolibarr is the Dolistore.
Templates for required images and texts are provided.
Check the dedicated README for more informations.
Feel free to contribute and report defects on our issue tracker.
GPLv3 or (at your option) any later version.
See COPYING for more information.
Used to display this README in the module's about page.
Licensed under MIT.
Public domain
All texts and readmes.