Line 394:
Line 394:
If you create a module that uses its own table, not available in the default Dolibarr code, then take a look at tutorial [[Module development]]. It explains how to provide new tables with your module, so that, the tables will be created during module activation and not during module usage.
If you create a module that uses its own table, not available in the default Dolibarr code, then take a look at tutorial [[Module development]]. It explains how to provide new tables with your module, so that, the tables will be created during module activation and not during module usage.
−
== Comparing version ==
+
== Comparing oversion ==
If your code need to make different things depending on Dolibarr version, you can use the following tip to detect and compare versions
If your code need to make different things depending on Dolibarr version, you can use the following tip to detect and compare versions
<source lang="php">
<source lang="php">
Line 401:
Line 401:
</source>
</source>
−
But this solution need to include the function versioncompare. An alternative solution is to do:
+
But this solution need to include the function versioncompare. An alternative solution to test version is to do:
<source lang="php">
<source lang="php">
if ((float) DOL_VERSION >= 5.0) { //mycode for 5.0 only; } // For dolibarr 5.0.*
if ((float) DOL_VERSION >= 5.0) { //mycode for 5.0 only; } // For dolibarr 5.0.*