fix project extrafields for ODT

for some raeson the code was checking for already existing extra fields before even fetching it. removed the if condition, now it works fine.
This commit is contained in:
Thomas Raschbacher
2017-05-10 15:21:53 +02:00
committed by GitHub
parent 267e66abfa
commit 70de54e97d

View File

@@ -131,18 +131,15 @@ class doc_generic_project_odt extends ModelePDFProjects
);
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options))
{
$extrafieldkey=$object->element;
$extrafieldkey=$object->element;
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
}
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
return $resarray;
}