diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c8f8a31b1dc..d3f619d19b6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -206,6 +206,28 @@ function getDolUserInt($key, $default = 0, $tmpuser = null) return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key); } +define( + 'DEPRECATED_MODULE_MAPPING', + array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'fichinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', + ) +); + /** * Is Dolibarr module enabled * @@ -217,17 +239,7 @@ function isModEnabled($module) global $conf; // Fix old names (map to new names) - $arrayconv = array( - 'adherent' => 'member', - 'banque' => 'bank', - 'categorie' => 'category', - 'commande' => 'order', - 'contrat' => 'contract', - 'expedition' => 'delivery_note', - 'facture' => 'invoice', - 'projet' => 'project', - 'propale' => 'propal', - ); + $arrayconv = DEPRECATED_MODULE_MAPPING; if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) { // Special cases: both use the same module. diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 7290d9562d6..f39e2540ef3 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -633,6 +633,7 @@ class CodingPhpTest extends CommonClassTest 'commande' => 'order', 'contrat' => 'contract', 'entrepot' => 'stock', + 'expedition' => 'delivery_note', 'facture' => 'invoice', 'fichinter' => 'intervention', 'product_fournisseur_price' => 'productsupplierprice', @@ -647,6 +648,7 @@ class CodingPhpTest extends CommonClassTest 'member_type' => 1, 'bank' => 1, 'category' => 1, + 'delivery_note' => 1, 'order' => 1, 'contract' => 1, 'stock' => 1, @@ -680,7 +682,6 @@ class CodingPhpTest extends CommonClassTest 'ecotax' => 1, 'emailcollector' => 1, 'eventorganization' => 1, - 'expedition' => 1, 'expensereport' => 1, 'export' => 1, 'externalsite' => 1,