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

Fix : in ODT show value and not label of company extrafield

parent 060060f0
No related branches found
No related tags found
No related merge requests found
......@@ -164,14 +164,20 @@ abstract class CommonDocGenerator
'company_note'=>$object->note
);
$extrafields = array();
// Retrieve extrafields
if(is_array($object->array_options) && count($object->array_options))
{
foreach($object->array_options as $key=>$label)
if(!class_exists('Extrafields'))
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('company',true);
//Get extrafield values
$object->fetch_optionals($object->id,$extralabels);
foreach($extrafields->attribute_label as $key=>$label)
{
$extrafields['company_'.$key] = $label;
$array_thirdparty=array_merge($array_thirdparty,array('company_options_'.$key => $object->array_options['options_'.$key]));
}
$array_thirdparty = array_merge($array_thirdparty,$extrafields);
}
return $array_thirdparty;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment