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:
@@ -206,6 +206,28 @@ function getDolUserInt($key, $default = 0, $tmpuser = null)
|
|||||||
return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key);
|
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
|
* Is Dolibarr module enabled
|
||||||
*
|
*
|
||||||
@@ -217,17 +239,7 @@ function isModEnabled($module)
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Fix old names (map to new names)
|
// Fix old names (map to new names)
|
||||||
$arrayconv = array(
|
$arrayconv = DEPRECATED_MODULE_MAPPING;
|
||||||
'adherent' => 'member',
|
|
||||||
'banque' => 'bank',
|
|
||||||
'categorie' => 'category',
|
|
||||||
'commande' => 'order',
|
|
||||||
'contrat' => 'contract',
|
|
||||||
'expedition' => 'delivery_note',
|
|
||||||
'facture' => 'invoice',
|
|
||||||
'projet' => 'project',
|
|
||||||
'propale' => 'propal',
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
|
if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
|
||||||
// Special cases: both use the same module.
|
// Special cases: both use the same module.
|
||||||
|
|||||||
@@ -633,6 +633,7 @@ class CodingPhpTest extends CommonClassTest
|
|||||||
'commande' => 'order',
|
'commande' => 'order',
|
||||||
'contrat' => 'contract',
|
'contrat' => 'contract',
|
||||||
'entrepot' => 'stock',
|
'entrepot' => 'stock',
|
||||||
|
'expedition' => 'delivery_note',
|
||||||
'facture' => 'invoice',
|
'facture' => 'invoice',
|
||||||
'fichinter' => 'intervention',
|
'fichinter' => 'intervention',
|
||||||
'product_fournisseur_price' => 'productsupplierprice',
|
'product_fournisseur_price' => 'productsupplierprice',
|
||||||
@@ -647,6 +648,7 @@ class CodingPhpTest extends CommonClassTest
|
|||||||
'member_type' => 1,
|
'member_type' => 1,
|
||||||
'bank' => 1,
|
'bank' => 1,
|
||||||
'category' => 1,
|
'category' => 1,
|
||||||
|
'delivery_note' => 1,
|
||||||
'order' => 1,
|
'order' => 1,
|
||||||
'contract' => 1,
|
'contract' => 1,
|
||||||
'stock' => 1,
|
'stock' => 1,
|
||||||
@@ -680,7 +682,6 @@ class CodingPhpTest extends CommonClassTest
|
|||||||
'ecotax' => 1,
|
'ecotax' => 1,
|
||||||
'emailcollector' => 1,
|
'emailcollector' => 1,
|
||||||
'eventorganization' => 1,
|
'eventorganization' => 1,
|
||||||
'expedition' => 1,
|
|
||||||
'expensereport' => 1,
|
'expensereport' => 1,
|
||||||
'export' => 1,
|
'export' => 1,
|
||||||
'externalsite' => 1,
|
'externalsite' => 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user