NEW remove keys whose table element is the same as element in map list
This commit is contained in:
parent
1e8dc90b41
commit
f3f840f7e8
@ -82,26 +82,26 @@ class ModeleImports
|
|||||||
'actioncomm' => 'agenda',
|
'actioncomm' => 'agenda',
|
||||||
'adherent' => 'member',
|
'adherent' => 'member',
|
||||||
'adherent_type' => 'member_type',
|
'adherent_type' => 'member_type',
|
||||||
'bank_account' => 'bank_account',
|
//'bank_account' => 'bank_account',
|
||||||
'categorie' => 'category',
|
'categorie' => 'category',
|
||||||
'commande' => 'commande',
|
//'commande' => 'commande',
|
||||||
'commande_fournisseur' => 'commande_fournisseur',
|
//'commande_fournisseur' => 'commande_fournisseur',
|
||||||
'contrat' => 'contract',
|
'contrat' => 'contract',
|
||||||
'entrepot' => 'stock',
|
'entrepot' => 'stock',
|
||||||
'expensereport' => 'expensereport',
|
//'expensereport' => 'expensereport',
|
||||||
'facture' => 'invoice',
|
'facture' => 'invoice',
|
||||||
'facture_fourn' => 'facture_fourn',
|
//'facture_fourn' => 'facture_fourn',
|
||||||
'fichinter' => 'intervention',
|
'fichinter' => 'intervention',
|
||||||
'holiday' => 'holiday',
|
//'holiday' => 'holiday',
|
||||||
'product' => 'product',
|
//'product' => 'product',
|
||||||
'product_price' => 'productprice',
|
'product_price' => 'productprice',
|
||||||
'product_fournisseur_price' => 'productsupplierprice',
|
'product_fournisseur_price' => 'productsupplierprice',
|
||||||
'projet' => 'project',
|
'projet' => 'project',
|
||||||
'propal' => 'propal',
|
//'propal' => 'propal',
|
||||||
'societe' => 'societe',
|
//'societe' => 'societe',
|
||||||
'socpeople' => 'contact',
|
'socpeople' => 'contact',
|
||||||
'supplier_proposal' => 'supplier_proposal',
|
//'supplier_proposal' => 'supplier_proposal',
|
||||||
'ticket' => 'ticket',
|
//'ticket' => 'ticket',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -313,13 +313,13 @@ class ModeleImports
|
|||||||
* Get element from table name with prefix
|
* Get element from table name with prefix
|
||||||
*
|
*
|
||||||
* @param string $tableNameWithPrefix Table name with prefix
|
* @param string $tableNameWithPrefix Table name with prefix
|
||||||
* @return string Element name or '' if not found
|
* @return string Element name or table element as default
|
||||||
*/
|
*/
|
||||||
public function getElementFromTableWithPrefix($tableNameWithPrefix)
|
public function getElementFromTableWithPrefix($tableNameWithPrefix)
|
||||||
{
|
{
|
||||||
$element = '';
|
|
||||||
|
|
||||||
$tableElement = preg_replace('/^'.preg_quote($this->db->prefix(), '/').'/', '', $tableNameWithPrefix);
|
$tableElement = preg_replace('/^'.preg_quote($this->db->prefix(), '/').'/', '', $tableNameWithPrefix);
|
||||||
|
$element = $tableElement;
|
||||||
|
|
||||||
if (isset(self::$mapTableToElement[$tableElement])) {
|
if (isset(self::$mapTableToElement[$tableElement])) {
|
||||||
$element = self::$mapTableToElement[$tableElement];
|
$element = self::$mapTableToElement[$tableElement];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user