Contents • • • • • • • • • • • • • Prerequisite • Dolibarr: 3.0+ • Knowledge in PHP development Find a model near your need In Dolibarr, test existing models by going to the module setup area and by clicking on the 'preview' logo. Among existing models, find the one that is the nearest of your need. In this example, we suppose it's the template 'azur' (corresponding to file pdf_propale_azur.modules.php). FYI, all models are in htdocs/core/modules, into subdirectory propale for commercial proposals, facture for invoices, commandes for orders, etc. Create your new template For security, we will retain the original models. For the example, we assume we creates a new template we call 'mycompanyblue' and inspired by the template 'azur': • Copy and paste file pdf_propale_azur.modules.php • Rename the copy into pdf_propale_mycompanyblue.modules.php • Edit and make the following changes in the code: • Rename 'Class pdf_propale_azur { ' into 'Class pdf_propale_mycompanyblue { ' • Rename 'Function pdf_propale_azur ($db=0)' into 'Function pdf_propale_mycompanyblue ($db=0)' • Rename constant $this->name to match your new template name. For example for 'azur' template, change line '$this->name = 'azur';' into '$this->name = 'mycompanyblue';'. Now template is available in the list of models into Dolibarr • Test this model (see previous section) before going further. Customize content of your new template Customize the template created. ![]() ![]() ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |