31,003
edits
| Line 117: | Line 117: | ||
You must then create your PHP pages that will show/edit data from tables using the skeleton templates provided as an example in the directory '''dev/skeletons''' (For the development of a script from the command line, see [[Script development]]). | You must then create your PHP pages that will show/edit data from tables using the skeleton templates provided as an example in the directory '''dev/skeletons''' (For the development of a script from the command line, see [[Script development]]). | ||
To create a new user screen, create a subdirectory of '''htdocs''' (if not already done) for your module (in '''htdocs/monmodule''' for example) to store the pages you will create. | |||
Copy, into that directory, the file '''skeletons_page.php''' that will serve as a starting point for your page file and also file '''pre.inc.php'''. | |||
Edit the file '''pre.inc.php''' to have a correct relative path to the main.inc.php file. | |||
<pre> | <pre> | ||
include("../../main.inc.php)"; | include("../../main.inc.php)"; | ||
</pre> | </pre> | ||
This depends on the depth of the directory in which the file is pre.inc.php (Add or remove "../"). | |||
It's in the main.inc.php file that is loaded technical environment variables and permissions. The following variables are objects positioned in this file: | |||
* $user | * $user Objet that contains the characteristics of the user + his permissions. | ||
* $conf | * $conf Objet that contains Dolibarr configuration. | ||
* $db | * $db Objet that contains an opened connection handler to the database. | ||
* $langs | * $langs Objet that contains the user's language. | ||
Then enter your code to display the page. | |||
== Accès à la base == | == Accès à la base == | ||