Table llx element element: Difference between revisions

 
(12 intermediate revisions by 3 users not shown)
Line 5: Line 5:
{{ListOfTables}}
{{ListOfTables}}


= Contenu =
= Content/Contenu/Contenido =
 
{{flag en}} This table allows to save the links between entities.
For example when a contract must be linked to a intervention card, we use this table.


{{flag fr}} Cette table permet de sauvegarder les liens entre entités.
{{flag fr}} Cette table permet de sauvegarder les liens entre entités.
Par exemple quand un contrat doit être lié à une fiche intervention, on utilisera cette table.
Par exemple quand un contrat doit être lié à une fiche intervention, on utilisera cette table.
Historiquement, les liens étaient stockés dans une table dédiée à chaque couple. En version 2.5 et plus, les liens doivent être stockés dans cette table.


{{flag sp}} Esta tabla le permite guardar los enlaces entre las entidades.
Por ejemplo, cuando un contrato debe estar vinculado a ficha de intervención, utilizaremos esta tabla.
= Structure =
== Table ==
{|  align="left" width="100%" border="0" cellpadding="1" cellspacing="0" class="dolbox"
|style="background-color: #e9e9ef"| <b>Field</b>
|style="background-color: #e9e9ef"| <b>Type</b>
|style="background-color: #e9e9ef"| <b>Null</b>
|style="background-color: #e9e9ef"| <b>Key</b>
|style="background-color: #e9e9ef"| <b>Default</b>
|style="background-color: #e9e9ef"| <b>Extra</b>
|style="background-color: #e9e9ef"| <b>Description</b>
|-
| rowid
| int(11)
| NO
| PRI
|
| auto_increment
| technical index
|-
| fk_source
| int(11)
| NO
|
|
|
| ID of source (any table_of_elements->rowid)
|-
| sourcetype
| varchar(16)
| NO
|
|
|
| type of source. view content section
|-
| fk_target
| int(11)
| NO
| MUL
|
|
| ID of target (any table_of_elements->rowid)
|-
| targettype
| varchar(16)
| NO
|
|
|
| type of target. view content section
|}&nbsp;
== Keys ==
{|  align="left" width="100%" border="0" cellpadding="1" cellspacing="0" class="dolbox"
|style="background-color: #e9e9ef"| <b>Key</b>
|style="background-color: #e9e9ef"| <b>Type</b>
|style="background-color: #e9e9ef"| <b>Fields</b>
|-
| PRIMARY
| PRIMARY
| rowid
|-
| idx_element_element_idx1
| UNIQUE
| fk_source,sourcetype,fk_target,targettype
|-
| idx_element_element_fk_target
| MULTIPLE
| fk_target
|}&nbsp;
= Notes =
{{flag en}} Historically, the links were stored in a table dedicated to each couple. In version 2.5 and above, the links should be stored in this table.
This table contains 4 columns to create the links.
* The id of the source object
* The type of the source (field sourcetype). The value to set is a code that indicates the nature of the entity.
* The id of the destination object
* The type of the destination object (field targettype). The value to set is a code that indicates the nature of the entity.
Here is the list of types to use for define the entity to its related id.
* "user" : In this case the id field must be an id of the table llx_user
* "intervention" : In this case the id field must be an id of the table llx_fichinter
* "invoice" : In this case the id field must be an id of the table llx_facture
* "supplier_invoice" : In this case the id field must be an id of the table llx_facture_fournisseur
* "contract" : In this case the id field must be an id of the table llx_contrat.
* "order" : In this case the id field must be an id of the table llx_commande
* "supplier_order" : In this case the id field must be an id of the table llx_commande_fournisseur
* "member" : In this case the id field must be an id of the table llx_adherent
* "propal" : In this case the id field must be an id of the table llx_propal
* "shipping" : In this case the id field must be an id of the table llx_expedition
* "delivery" : In this case the id field must be an id of the table llx_livraison
This allows to use 1 single table for any type of links instead of 2<sup>n</sup> tables (where n is the number of managed entities in Dolibarr).
{{flag fr}} Historiquement, les liens étaient stockés dans une table dédiée à chaque couple. En version 2.5 et plus, les liens doivent être stockés dans cette table.
Cette table contient 4 colonnes pour créer les liens.
Cette table contient 4 colonnes pour créer les liens.
* L'id de l'objet source
* L'id de l'objet source
Line 26: Line 128:
* "supplier_order" : Dans ce cas le champ doit être un id de la table llx_commande_fournisseur
* "supplier_order" : Dans ce cas le champ doit être un id de la table llx_commande_fournisseur
* "member" : Dans ce cas le champ doit être un id de la table llx_adherent
* "member" : Dans ce cas le champ doit être un id de la table llx_adherent
* "propal" : Dans ce cas le champ doit être un id de la table llx_propal
* "shipping" : Dans ce cas le champ doit être un id de la table llx_expedition
* "delivery" : Dans ce cas le champ doit être un id de la table llx_livraison


Ce type permet d'utiliser 1 seule et même table pour tout type de liaison au lieu de 2<sup>n</sup> tables (n étant le nombre d'entités gérées dans dolibarr).
Ce type permet d'utiliser 1 seule et même table pour tout type de liaison au lieu de 2<sup>n</sup> tables (n étant le nombre d'entités gérées dans dolibarr).


 
{{flag sp}} Históricamente, los vínculos se almacenaban en una tabla dedicada a cada pareja. En la versión 2.5 y superiores, los enlaces se deben almacenar en esta tabla.
{{flag sp}} Esta tabla le permite guardar los enlaces entre las entidades.
Por ejemplo, cuando un contrato debe estar vinculado a ficha de intervención, utilizaremos esta tabla. Históricamente, los vínculos se almacenaban en una tabla dedicada a cada pareja. En la versión 2.5 y superiores, los enlaces se deben almacenar en esta tabla.
 
Esta tabla contiene 4 columnas para crear los enlaces.
Esta tabla contiene 4 columnas para crear los enlaces.
* El id del objeto origen
* El id del objeto origen
Line 48: Line 150:
* "supplier_order" : En este caso el campo id debe de ser un id de la tabla llx_commande_fournisseur
* "supplier_order" : En este caso el campo id debe de ser un id de la tabla llx_commande_fournisseur
* "member" : En este caso el campo id debe de ser un id de la tabla llx_adherent
* "member" : En este caso el campo id debe de ser un id de la tabla llx_adherent
* "propal" : En este caso el campo id debe de ser un id de la tabla llx_propal
* "shipping" : En este caso el campo id debe de ser un id de la tabla llx_expedition
* "delivery" : En este caso el campo id debe de ser un id de la tabla llx_livraison


Este tipo permite utilizar 1 sola y única tabla para todo tipo de enlace en lugar de 2<sup>n</sup> tablas (n son el número de entidades gestionadas en Dolibarr).
Este tipo permite utilizar 1 sola y única tabla para todo tipo de enlace en lugar de 2<sup>n</sup> tablas (n son el número de entidades gestionadas en Dolibarr).
= Structure =
{|  align="left" width="100%" border="0" rules="all" cellpadding="1" cellspacing="0"  style="margin: 0 0 1px 1px; border: 1px solid #dddddd; border-right-width: 2px; border-bottom-width: 2px; background-color: #f3f3f5"
|style="background-color: #e9e9ef"| <b>Field</b>
|style="background-color: #e9e9ef"| <b>Type</b>
|style="background-color: #e9e9ef"| <b>Null</b>
|style="background-color: #e9e9ef"| <b>Key</b>
|style="background-color: #e9e9ef"| <b>Default</b>
|style="background-color: #e9e9ef"| <b>Extra</b>
|style="background-color: #e9e9ef"| <b>Description</b>
|-
| rowid
| int(11)
| &nbsp;
| PRI
| NULL
| auto_increment
| technical index
|}