diff --git a/core/modules/digiriskdolibarr/digiriskdocuments/preventionplandocument/doc_preventionplandocument_odt.modules.php b/core/modules/digiriskdolibarr/digiriskdocuments/preventionplandocument/doc_preventionplandocument_odt.modules.php index 44a15f5b3..854ccb876 100644 --- a/core/modules/digiriskdolibarr/digiriskdocuments/preventionplandocument/doc_preventionplandocument_odt.modules.php +++ b/core/modules/digiriskdolibarr/digiriskdocuments/preventionplandocument/doc_preventionplandocument_odt.modules.php @@ -268,6 +268,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails $tmparray['photoDefault'] = $image['fullname']; } + $digiriskelement = new DigiriskElement($this->db); $resources = new DigiriskResources($this->db); $signatory = new PreventionPlanSignature($this->db); $societe = new Societe($this->db); @@ -421,8 +422,10 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails foreach ($preventionplanlines as $line) { + $digiriskelement->fetch($line->fk_element); + $tmparray['key_unique'] = $line->ref; - $tmparray['unite_travail'] = $line->fk_element; + $tmparray['unite_travail'] = $digiriskelement->ref . " - " . $digiriskelement->label; $tmparray['action'] = $line->description; $tmparray['risk'] = DOL_DOCUMENT_ROOT . '/custom/digiriskdolibarr/img/categorieDangers/' . $risk->get_danger_category($line) . '.png'; $tmparray['prevention'] = $line->prevention_method;