addExtraField ( $attrname,$label, $type, $pos,$size,$elementtype,$unique = 0,$required = 0,$default_value = '',
$param = '',$alwayseditable = 0,$perms = '',$list = '-1',$help = '',$computed = '',$entity = '',$langfile = '',$enabled = '1',$totalizable = 0,$printable = 0)
Add a new extra field parameter.
string $attrname Code of attribute
string $label label of attribute
string $type Type of attribute
('boolean','int','varchar','text','html','date','datehour','price','phone','mail','password','url','select','checkbox','separate',...)
int $pos Position of attribute
string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma.
string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...)
int $unique Is field unique or not
int $required Is field required or not
string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null',
'avalue')
array | string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
int $alwayseditable Is attribute always editable regardless of the document status
string $perms Permission to check
string $list Visibilty ('0'=never visible, '1'=visible on list+forms, '2'=list only, '3'=form only or 'eval string')
string $help Text with help tooltip
string $computed Computed value
string $entity Entity of extrafields (for multicompany modules)
string $langfile Language file
string $enabled Condition to have the field enabled or not
int $totalizable Is a measure. Must show a total on lists
int $printable Is extrafield displayed on PDF
Returns
int <=0 if KO, >0 if OK