mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
move actioncomm
This commit is contained in:
parent
3301790647
commit
ebc54f82e6
|
|
@ -2203,6 +2203,26 @@ class ActionComm extends CommonObject
|
|||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to replace a product id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old product id
|
||||
* @param int $dest_id New product id
|
||||
* @return bool
|
||||
*/
|
||||
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
|
||||
{
|
||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'actioncomm SET fk_element = ' . ((int) $dest_id) . ' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
|
||||
|
||||
if (!$db->query($sql)) {
|
||||
//$this->errors = $db->lasterror();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the action delayed?
|
||||
*
|
||||
|
|
|
|||
|
|
@ -311,21 +311,23 @@ if (empty($reshook)) {
|
|||
// TODO add this functionality into the api_products.class.php
|
||||
// TODO Mutualise the list into object product.class.php
|
||||
$objects = array(
|
||||
'ActionComm' => '/comm/action/class/actioncomm.class.php',
|
||||
'Bom' => '/bom/class/bom.class.php',
|
||||
// do not use Categorie, it cause foreign key error, merge is done before
|
||||
//'Categorie' => '/categories/class/categorie.class.php',
|
||||
'Propal' => '/comm/propal/class/propal.class.php',
|
||||
'Commande' => '/commande/class/commande.class.php',
|
||||
'Facture' => '/compta/facture/class/facture.class.php',
|
||||
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
|
||||
'Bom' => '/bom/class/bom.class.php',
|
||||
'Contrat' => '/contrat/class/contrat.class.php',
|
||||
'Reception' => '/reception/class/reception.class.php',
|
||||
'FichinterRec' => '/fichinter/class/fichinterrec.class.php',
|
||||
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
|
||||
'Contrat' => '/contrat/class/contrat.class.php',
|
||||
'Delivery' => '/delivery/class/delivery.class.php',
|
||||
'Facture' => '/compta/facture/class/facture.class.php',
|
||||
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
|
||||
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
|
||||
'FichinterRec' => '/fichinter/class/fichinterrec.class.php',
|
||||
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
|
||||
'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
|
||||
'Delivery' => '/delivery/class/delivery.class.php',
|
||||
'Propal' => '/comm/propal/class/propal.class.php',
|
||||
'Reception' => '/reception/class/reception.class.php',
|
||||
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
|
||||
);
|
||||
|
||||
//First, all core objects must update their tables
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user