3
edits
(Roughly translated French to English using online translation tool and English fluency.) |
|||
| Line 1: | Line 1: | ||
{{TemplateDocDevEn}} | {{TemplateDocDevEn}} | ||
{{ToTranslate}} | {{ToTranslate}} | ||
The generated documents are stored in the directory defined by the constant DOL_DATA_ROOT | |||
= | = To generate documents in new modules = | ||
If you generate documents in a new module, your files must be stored in | |||
* DOL_DATA_ROOT/monmodule | * DOL_DATA_ROOT/monmodule for permanent files. | ||
* DOL_DATA_ROOT/monmodule/temp | * DOL_DATA_ROOT/monmodule/temp for temporary files. | ||
To create these directories, you can use the function to create_exdir (DOL_DATA_ROOT/monmodule); | |||
create_exdir(DOL_DATA_ROOT/monmodule); | |||
To generate these files on the Dolibarr model, create the following files: | |||
# | # the card where to place the "cartouche" (posting) allowing the user to generate a new document and to consult the existing documents. | ||
# ''htdocs/includes/modules/mod[ | # ''htdocs/includes/modules/mod [standard of document] .class.php'' if this file wouldn't exist already | ||
# ''htdocs/includes/modules/[ | # ''htdocs/includes/modules/[standard of document] /module_ [standard] .php'' which will contain the definition of the class of generation | ||
# ''htdocs/includes/modules/[ | # ''htdocs/includes/modules/[standard of document] /pdf_ [model] _ [standard] .modules.php'' which will contain the model of generation of the document | ||
# ''htdocs/document.php'' | # ''htdocs/document.php'' which contains the procedure of delivery of the files once created (and their suppression) - it is also necessary to add to it the type of document and the corresponding directory | ||
# | # The class(es) which contain the data to be posted (classes product.class.php or facture.class.php, or others, according to the document to be generated) | ||
To be able to download the files generated by using the mechanism of safety of Dolibarr, it is advisable to modify the files according to: | |||
# ''htdocs/html.form.class.php'' | # ''htdocs/html.form.class.php'' to add to it, in the method '''show_documents()''', the type of added document. | ||
The model also needs to be inserted into the database, in the [[Table llx_document_model]] the type of document in the type field and the name of the corresponding class in includes/modules (starting with pdf_) in the name field. | |||
To know how to build | To know how to build a template, see page [[Create an ODT document template]] or [[Create a pdf document template]]. Building a pdf template requires PHP development knowledge, but building an ODT template does not. | ||
edits