diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 505c345c256..287976119f9 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1670,6 +1670,16 @@ class BOMLine extends CommonObjectLine */ public $table_element = 'bom_bomline'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'bom'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_bom'; + /** * @var string String with name of icon for bomline. Must be the part after the 'object_' into object_bomline.png */ diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 851cf464668..acb543631d6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3975,6 +3975,16 @@ class PropaleLigne extends CommonObjectLine */ public $table_element = 'propaldet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'propal'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_propal'; + public $oldline; // From llx_propaldet diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 573bb9477ff..16c9326ec9b 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -2143,6 +2143,16 @@ class FactureLigneRec extends CommonInvoiceLine */ public $table_element = 'facturedet_rec'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'facturerec'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_facture'; + //! From llx_facturedet_rec //! Id facture public $fk_facture; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 68211f0408c..e14f2e3c7fb 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3009,6 +3009,16 @@ class ContratLigne extends CommonObjectLine */ public $table_element = 'contratdet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'contrat'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_contrat'; + /** * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 052e22368cf..d58838ca9f3 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -33,6 +33,16 @@ */ abstract class CommonObjectLine extends CommonObject { + /** + * @var string ID to identify parent CommonObject type (element name) + */ + public $parent_element = ''; + + /** + * @var string Attribute related to parent CommonObject rowid (many2one) + */ + public $fk_parent_attribute = ''; + /** * Id of the line * @var int diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ebfefa24a44..6f140ec0b59 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2656,6 +2656,15 @@ class ExpeditionLigne extends CommonObjectLine */ public $table_element = 'expeditiondet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'expedition'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_expedition'; /** * Id of the line. Duplicate of $id. diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 47de9d5733a..6417da46447 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3741,6 +3741,16 @@ class CommandeFournisseurLigne extends CommonOrderLine */ public $table_element = 'commande_fournisseurdet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'commande_fournisseur'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_commande_fournisseur'; + public $oldline; /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b014f3b3223..f98d3b46ab6 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -3732,6 +3732,16 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $table_element = 'facture_fourn_det'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'facture_fourn'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_facture_fourn'; + /** * @var static */ diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 005bb6b7fd8..6c6bbfdc159 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -52,6 +52,16 @@ class EvaluationLine extends CommonObjectLine */ public $table_element = 'hrm_evaluationdet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'hrm_evaluation'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_evaluation'; + /** * @var string String with name of icon for evaluationdet. Must be the part after the 'object_' into object_evaluationdet.png */ diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 8e84bffd2a5..ab036ae0664 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -50,6 +50,16 @@ class Skilldet extends CommonObjectLine */ public $table_element = 'hrm_skilldet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'skill'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_skill'; + /** * @var string String with name of icon for skilldet. Must be the part after the 'object_' into object_skilldet.png */ diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 89b6bb99e9b..74082329a6d 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -1250,6 +1250,18 @@ class MyObjectLine extends CommonObjectLine // To complete with content of an object MyObjectLine // We should have a field rowid, fk_myobject and position + /** + * To overload + * @see CommonObjectLine + */ + public $parent_element = ''; + + /** + * To overload + * @see CommonObjectLine + */ + public $fk_parent_attribute = ''; + /** * Constructor * diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 0bab434a760..0a2a71c395c 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -2001,6 +2001,16 @@ class MoLine extends CommonObjectLine */ public $table_element = 'mrp_production'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'mo'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_mo'; + /** * 'type' field format: * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index ddf130625b4..c1c7772f37a 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -800,6 +800,16 @@ class InventoryLine extends CommonObjectLine */ public $table_element = 'inventorydet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'inventory'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_inventory'; + /** * @var string String with name of icon for inventory */ diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index a8ba2385a90..be52049971a 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2815,6 +2815,16 @@ class SupplierProposalLine extends CommonObjectLine */ public $table_element = 'supplier_proposaldet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'supplier_proposal'; + + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_supplier_proposal'; + public $oldline; /**