From 9348d1bfa8b20c5022748136be2a56d574bd279d Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Thu, 16 May 2024 10:17:07 +0200 Subject: [PATCH 1/3] #3888 [Trigger] fix: replace
by
for document print purpose --- class/accidentinvestigation.class.php | 16 ++++++++-------- class/digiriskdocuments.class.php | 4 ++-- class/preventionplan.class.php | 2 +- .../doc_ticketdocument_odt.modules.php | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/class/accidentinvestigation.class.php b/class/accidentinvestigation.class.php index b915e3cf9..0f8966f60 100644 --- a/class/accidentinvestigation.class.php +++ b/class/accidentinvestigation.class.php @@ -325,14 +325,14 @@ public function getTriggerDescription(SaturneObject $object): string } $ret = parent::getTriggerDescription($object); - $ret .= $langs->transnoentities('Accident') . ' : ' . $accident->ref . ' - ' . $accident->label . '
'; - $ret .= ($object->fk_task > 0 ? $langs->transnoentities('Task') . ' : ' . $task->ref . ' - ' . $task->label . '
': ''); - $ret .= (dol_strlen($object->seniority_in_position) > 0 ? $langs->transnoentities('SeniorityInPosition') . ' : ' . $object->seniority_in_position . '
' : ''); - $ret .= (dol_strlen($object->victim_skills) > 0 ? $langs->transnoentities('VictimSkills') . ' : ' . $object->victim_skills . '
' : ''); - $ret .= (dol_strlen($object->collective_equipment) > 0 ? $langs->transnoentities('CollectiveEquipment') . ' : ' . $object->collective_equipment . '
' : ''); - $ret .= (dol_strlen($object->individual_equipment) > 0 ? $langs->transnoentities('IndividualEquipment') . ' : ' . $object->individual_equipment . '
' : ''); - $ret .= (dol_strlen($object->circumstances) > 0 ? $langs->transnoentities('Circumstances') . ' : ' . $object->circumstances . '
' : ''); - $ret .= (dol_strlen($object->causality_tree) > 0 ? $langs->transnoentities('CausalityTree') . ' : ' . $object->causality_tree . '
' : ''); + $ret .= $langs->transnoentities('Accident') . ' : ' . $accident->ref . ' - ' . $accident->label . '
'; + $ret .= ($object->fk_task > 0 ? $langs->transnoentities('Task') . ' : ' . $task->ref . ' - ' . $task->label . '
': ''); + $ret .= (dol_strlen($object->seniority_in_position) > 0 ? $langs->transnoentities('SeniorityInPosition') . ' : ' . $object->seniority_in_position . '
' : ''); + $ret .= (dol_strlen($object->victim_skills) > 0 ? $langs->transnoentities('VictimSkills') . ' : ' . $object->victim_skills . '
' : ''); + $ret .= (dol_strlen($object->collective_equipment) > 0 ? $langs->transnoentities('CollectiveEquipment') . ' : ' . $object->collective_equipment . '
' : ''); + $ret .= (dol_strlen($object->individual_equipment) > 0 ? $langs->transnoentities('IndividualEquipment') . ' : ' . $object->individual_equipment . '
' : ''); + $ret .= (dol_strlen($object->circumstances) > 0 ? $langs->transnoentities('Circumstances') . ' : ' . $object->circumstances . '
' : ''); + $ret .= (dol_strlen($object->causality_tree) > 0 ? $langs->transnoentities('CausalityTree') . ' : ' . $object->causality_tree . '
' : ''); return $ret; } diff --git a/class/digiriskdocuments.class.php b/class/digiriskdocuments.class.php index 9652d3c64..b402f9335 100644 --- a/class/digiriskdocuments.class.php +++ b/class/digiriskdocuments.class.php @@ -462,8 +462,8 @@ public function getTriggerDescription(SaturneObject $object): string $ret = parent::getTriggerDescription($object); - $ret .= $langs->transnoentities('ElementType') . ' : ' . $object->parent_type . '
'; - $ret .= $langs->transnoentities('ParentElement') . ' : ' . $parentElement->ref . ' ' . $parentElement->label . '
'; + $ret .= $langs->transnoentities('ElementType') . ' : ' . $object->parent_type . '
'; + $ret .= $langs->transnoentities('ParentElement') . ' : ' . $parentElement->ref . ' ' . $parentElement->label . '
'; $ret .= $langs->transnoentities('LastMainDoc') . ' : ' . $object->last_main_doc . '
'; return $ret; diff --git a/class/preventionplan.class.php b/class/preventionplan.class.php index ed2c29d99..5a45848f0 100644 --- a/class/preventionplan.class.php +++ b/class/preventionplan.class.php @@ -401,7 +401,7 @@ public function getTriggerDescription(SaturneObject $object): string $ret .= $langs->transnoentities('CSSCTIntervention') . ' : ' . ($object->cssct_intervention ? $langs->transnoentities("Yes") : $langs->transnoentities("No")) . '
'; $ret .= $langs->transnoentities('PriorVisit') . ' : ' . ($object->prior_visit_bool ? $langs->transnoentities("Yes") : $langs->transnoentities("No")) . '
'; if ($object->prior_visit_bool) { - $ret .= $langs->transnoentities('PriorVisitText') . ' : ' . (!empty($object->prior_visit_text) ? $object->prior_visit_text : 'N/A') . '
'; + $ret .= $langs->transnoentities('PriorVisitText') . ' : ' . (!empty($object->prior_visit_text) ? $object->prior_visit_text : 'N/A') . '
'; $ret .= (dol_strlen($object->prior_visit_date) > 0 ? $langs->transnoentities('PriorVisitDate') . ' : ' . dol_print_date($object->prior_visit_date, 'dayhoursec') . '
' : ''); } diff --git a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php index 71ddb2b87..933f5b892 100644 --- a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php +++ b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php @@ -107,7 +107,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo $tmpArray['user'] = dol_strtoupper($userTmp->lastname) . ' ' . ucfirst($userTmp->firstname); $tmpArray['type'] = $outputLangs->transnoentities('Action' . $actionComm->type_code); $tmpArray['title'] = $actionComm->label; - $tmpArray['event_content'] = dol_htmlentitiesbr_decode(str_replace('
', "\r\n", $actionComm->note)); + $tmpArray['event_content'] = $actionComm->note; $tmpArray['date'] = dol_print_date($actionComm->datec, 'dayreduceformat'); $this->setTmpArrayVars($tmpArray, $listLines, $outputLangs); From ae30d63a99ea14632052b10527dbef6ecc78b521 Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Fri, 17 May 2024 11:50:20 +0200 Subject: [PATCH 2/3] #3888 [Code] fix: replace
by
--- class/actions_digiriskdolibarr.class.php | 2 +- .../risk/digiriskdolibarr_risklist_view.tpl.php | 2 +- .../risk/digiriskdolibarr_sharedrisklist_view.tpl.php | 2 +- langs/fr_FR/digiriskdolibarr.lang | 2 +- public/ticket/create_ticket.php | 2 +- view/accidentinvestigation/accidentinvestigation_card.php | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/class/actions_digiriskdolibarr.class.php b/class/actions_digiriskdolibarr.class.php index 4fbe3b64d..ad5f1addb 100644 --- a/class/actions_digiriskdolibarr.class.php +++ b/class/actions_digiriskdolibarr.class.php @@ -229,7 +229,7 @@ public function printCommonFooter($parameters) $linkedAccidentList = ''; if (is_array($linkedAccidents) && !empty($linkedAccidents)) { foreach ($linkedAccidents as $linkedAccident) { - $linkedAccidentList .= $linkedAccident->getNomUrl(1) . '
'; + $linkedAccidentList .= $linkedAccident->getNomUrl(1) . '
'; } } diff --git a/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php b/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php index e3ad7f691..8944a0b4e 100644 --- a/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php +++ b/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php @@ -1223,7 +1223,7 @@ class="risk-evaluation-cotation cotation"> $digiriskElementIds = array_reverse($digiriskElementIds); foreach ($digiriskElementIds as $key => $digiriskElementId) { - print str_repeat('  ', $key + 1) . '↳' . $activeDigiriskElementList[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '
'; + print str_repeat('  ', $key + 1) . '↳' . $activeDigiriskElementList[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '
'; } } } diff --git a/core/tpl/riskanalysis/risk/digiriskdolibarr_sharedrisklist_view.tpl.php b/core/tpl/riskanalysis/risk/digiriskdolibarr_sharedrisklist_view.tpl.php index a5730691c..916f73bad 100644 --- a/core/tpl/riskanalysis/risk/digiriskdolibarr_sharedrisklist_view.tpl.php +++ b/core/tpl/riskanalysis/risk/digiriskdolibarr_sharedrisklist_view.tpl.php @@ -556,7 +556,7 @@ $digiriskElementIds = array_reverse($digiriskElementIds); foreach ($digiriskElementIds as $key => $digiriskElementId) { - print str_repeat('  ', $key + 1) . '↳' . $alldigiriskelement[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '
'; + print str_repeat('  ', $key + 1) . '↳' . $alldigiriskelement[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '
'; } } } diff --git a/langs/fr_FR/digiriskdolibarr.lang b/langs/fr_FR/digiriskdolibarr.lang index 9d1a0ebd2..058754b6c 100644 --- a/langs/fr_FR/digiriskdolibarr.lang +++ b/langs/fr_FR/digiriskdolibarr.lang @@ -1454,7 +1454,7 @@ AT = au LabourInspectorName = DREETS UrlLabourInspector = https://travail-emploi.gouv.fr/ministere/organisation/article/dreets-directions-regionales-de-l-economie-de-l-emploi-du-travail-et-des -IDCCTooltip = Ce champ provient du module Digirisk pour Dolibarr
La nomenclature des conventions collectives provient de travail-emploi.gouv.fr +IDCCTooltip = Ce champ provient du module Digirisk pour Dolibarr
La nomenclature des conventions collectives provient de travail-emploi.gouv.fr NoEmailContact = Pas d'email sur ce contact AddMedia = Ajouter un média NoMediaLinked = Pas de média lié diff --git a/public/ticket/create_ticket.php b/public/ticket/create_ticket.php index 0229f4b86..c611390f3 100644 --- a/public/ticket/create_ticket.php +++ b/public/ticket/create_ticket.php @@ -537,7 +537,7 @@ } if ($entity > 0 && dolibarr_get_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 0) == 1) { if ($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_VISIBLE) { - $selectDigiriskElement = '
global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? 'style="font-weight:600"' : '') . '>' . $langs->trans('Service') . (($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? ' *' : '') . ''; + $selectDigiriskElement = '
global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? 'style="font-weight:600"' : '') . '>' . $langs->trans('Service') . (($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? ' *' : '') . ''; $deletedElements = $digiriskelement->getMultiEntityTrashList(); if (empty($deletedElements)) { diff --git a/view/accidentinvestigation/accidentinvestigation_card.php b/view/accidentinvestigation/accidentinvestigation_card.php index 10b5e544c..2fcee6c3f 100644 --- a/view/accidentinvestigation/accidentinvestigation_card.php +++ b/view/accidentinvestigation/accidentinvestigation_card.php @@ -168,7 +168,7 @@ if ($resOne > 0 && $resTwo > 0) { setEventMessages('AccidentInvestigationTaskCreated', []); $task->fetch($result); - $description = $getNomResOne . '
' . $getNomResTwo; + $description = $getNomResOne . '
' . $getNomResTwo; $task->setValueFrom('description', $description); } else { setEventMessages($task->error, [], 'errors'); @@ -243,7 +243,7 @@ // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - print '
'; + print '
'; print dol_get_fiche_end(); @@ -270,7 +270,7 @@ // Common attributes include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; - print '
'; + print '
'; print dol_get_fiche_end(); From 91419d7ea3ed92f013742e1ea8a471462f7f0dc5 Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Fri, 17 May 2024 14:07:29 +0200 Subject: [PATCH 3/3] #3888 [TicketDocument] add: dol_htmlentitiesbr_decode on note --- .../ticketdocument/doc_ticketdocument_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php index 933f5b892..10a865cd2 100644 --- a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php +++ b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/ticketdocument/doc_ticketdocument_odt.modules.php @@ -107,7 +107,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo $tmpArray['user'] = dol_strtoupper($userTmp->lastname) . ' ' . ucfirst($userTmp->firstname); $tmpArray['type'] = $outputLangs->transnoentities('Action' . $actionComm->type_code); $tmpArray['title'] = $actionComm->label; - $tmpArray['event_content'] = $actionComm->note; + $tmpArray['event_content'] = dol_htmlentitiesbr_decode($actionComm->note); $tmpArray['date'] = dol_print_date($actionComm->datec, 'dayreduceformat'); $this->setTmpArrayVars($tmpArray, $listLines, $outputLangs);