Skip to content
Snippets Groups Projects
Commit fa53147d authored by Jean-François Ferry's avatar Jean-François Ferry
Browse files

Retrieve extrafields when fetch thirparty

Work on extrafields support in thirpdparty ODT document
parent 91215a07
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ abstract class CommonDocGenerator
$object->state=getState($object->state_code,0);
}
return array(
$array_thirdparty = array(
'company_name'=>$object->name,
'company_email'=>$object->email,
'company_phone'=>$object->phone,
......@@ -163,6 +163,17 @@ abstract class CommonDocGenerator
'company_idprof6'=>$object->idprof6,
'company_note'=>$object->note
);
$extrafields = array();
if(is_array($object->array_options) && count($object->array_options))
{
foreach($object->array_options as $key=>$label)
{
$extrafields['company_options_'.$key] = $label;
}
$array_thirdparty = array_merge($array_thirdparty,$extrafields);
}
return $array_thirdparty;
}
/**
......
......@@ -140,6 +140,8 @@ class Societe extends CommonObject
var $logo_small;
var $logo_mini;
var $array_options;
var $oldcopy;
/**
......@@ -852,6 +854,18 @@ class Societe extends CommonObject
$this->import_key = $obj->import_key;
$result = 1;
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label('company',true);
if (count($extralabels)>0) {
$this->array_options = array();
}
foreach($extrafields->attribute_label as $key=>$label)
{
$this->array_options[$key]=$label;
}
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment