Fix #9092
This commit is contained in:
parent
a1bdc6022d
commit
7e9a2c5ec7
@ -543,7 +543,7 @@ abstract class CommonDocGenerator
|
||||
$tmpproduct = new Product($this->db);
|
||||
$result = $tmpproduct->fetch($line->fk_product);
|
||||
foreach($tmpproduct->array_options as $key=>$label)
|
||||
$resarray["line_".$key] = $label;
|
||||
$resarray["line_product_".$key] = $label;
|
||||
}
|
||||
|
||||
return $resarray;
|
||||
@ -722,6 +722,30 @@ abstract class CommonDocGenerator
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale']));
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc']));
|
||||
}
|
||||
else if($extrafields->attribute_type[$key] == 'link')
|
||||
{
|
||||
$id = $object->array_options['options_'.$key];
|
||||
if ($id != "")
|
||||
{
|
||||
$param = $extrafields->attribute_param[$key];
|
||||
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
$classname=$InfoFieldList[0];
|
||||
$classpath=$InfoFieldList[1];
|
||||
if (! empty($classpath))
|
||||
{
|
||||
dol_include_once($InfoFieldList[1]);
|
||||
if ($classname && class_exists($classname))
|
||||
{
|
||||
$tmpobject = new $classname($this->db);
|
||||
$tmpobject->fetch($id);
|
||||
// completely replace the id with the linked object name
|
||||
$object->array_options['options_'.$key] = $tmpobject->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user