Extrafields: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (Import interlang links (links to translated versions of this page in other languages) from Multi Language Manager table.)
No edit summary
Tag: 2017 source edit
Line 7: Line 7:


{{TemplateDocDevEn}}
{{TemplateDocDevEn}}
= Extrafields =


Extrafields allow to add others datas to Dolibarr standard database schema. Introduced in version 3.2, extrafields are now implemented in most business objects :
Extrafields allow to add others datas to Dolibarr standard database schema. Introduced in version 3.2, extrafields are now implemented in most business objects :
Line 25: Line 24:
* Expense Report
* Expense Report


== Technical implementation ==
= Technical implementation =


Each object has its table in database to store values of extrafields.
Each object has its table in database to store values of extrafields.
Line 48: Line 47:
   ) ENGINE=innodb;
   ) ENGINE=innodb;


= Usage =
== Load class for extrafields ==
== Load class for extrafields ==
To use extrafields all pages need include  
To use extrafields all pages need include  
Line 88: Line 88:
</source>
</source>
Where XXX is the code of the extrafields
Where XXX is the code of the extrafields
A dedicated page to show how to integrate extrafileds into PDF can be found there : [[Add Extrafields on PDF Models]]


== Display extrafield value of lines into PDF or HTML ==
== Display extrafield value of lines into PDF or HTML ==
Line 104: Line 106:
Where XXX is the code of the extrafields
Where XXX is the code of the extrafields


== How to change the labels of the columns when using models (propals, etc.) ==
In the PHP code of the model you can change the labels of your extrafield by changing into the function named "_tableau(...)"


== Before call $object->create() or $object->update() ==
== Before call $object->create() or $object->update() ==
Line 186: Line 191:
</source>
</source>


==Repair Database ==
=Repair Database =
Search and find definition of $listofmodulesextra add the new extrafield declaration
Search and find definition of $listofmodulesextra add the new extrafield declaration
<source lang="php">
<source lang="php">
Line 194: Line 199:
'adherent_type'=>'adherent_type','user'=>'user','projet'=>'projet', 'projet_task'=>'projet_task');
'adherent_type'=>'adherent_type','user'=>'user','projet'=>'projet', 'projet_task'=>'projet_task');
</source>
</source>
== How to change the labels of the columns when using models (propals, etc.) ==
In the PHP code of the model you can change the labels of your extrafield by changing into the function named "_tableau(...)"
676

edits

Navigation menu