2
0
forked from Wavyzz/dolibarr

NEW: Global constant for deprecated module mapping (#28348)

* Qual: Add another deprecated module mapping

* NEW: Global constant for deprecated module mapping
This commit is contained in:
MDW
2024-02-22 13:23:39 +01:00
committed by GitHub
parent 2b4bc3b4bc
commit f1f516f54c
2 changed files with 25 additions and 12 deletions

View File

@@ -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.

View File

@@ -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,