Skip to content

Commit

Permalink
Merge pull request #3889 from evarisk-micka/fix_br_triggerdescription
Browse files Browse the repository at this point in the history
#3888 [Trigger] fix: replace </br> by <br> for document print purpose
  • Loading branch information
nicolas-eoxia authored May 17, 2024
2 parents bfa6756 + 91419d7 commit 4e1a212
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions class/accidentinvestigation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,14 @@ public function getTriggerDescription(SaturneObject $object): string
}

$ret = parent::getTriggerDescription($object);
$ret .= $langs->transnoentities('Accident') . ' : ' . $accident->ref . ' - ' . $accident->label . '</br>';
$ret .= ($object->fk_task > 0 ? $langs->transnoentities('Task') . ' : ' . $task->ref . ' - ' . $task->label . '</br>': '');
$ret .= (dol_strlen($object->seniority_in_position) > 0 ? $langs->transnoentities('SeniorityInPosition') . ' : ' . $object->seniority_in_position . '</br>' : '');
$ret .= (dol_strlen($object->victim_skills) > 0 ? $langs->transnoentities('VictimSkills') . ' : ' . $object->victim_skills . '</br>' : '');
$ret .= (dol_strlen($object->collective_equipment) > 0 ? $langs->transnoentities('CollectiveEquipment') . ' : ' . $object->collective_equipment . '</br>' : '');
$ret .= (dol_strlen($object->individual_equipment) > 0 ? $langs->transnoentities('IndividualEquipment') . ' : ' . $object->individual_equipment . '</br>' : '');
$ret .= (dol_strlen($object->circumstances) > 0 ? $langs->transnoentities('Circumstances') . ' : ' . $object->circumstances . '</br>' : '');
$ret .= (dol_strlen($object->causality_tree) > 0 ? $langs->transnoentities('CausalityTree') . ' : ' . $object->causality_tree . '</br>' : '');
$ret .= $langs->transnoentities('Accident') . ' : ' . $accident->ref . ' - ' . $accident->label . '<br>';
$ret .= ($object->fk_task > 0 ? $langs->transnoentities('Task') . ' : ' . $task->ref . ' - ' . $task->label . '<br>': '');
$ret .= (dol_strlen($object->seniority_in_position) > 0 ? $langs->transnoentities('SeniorityInPosition') . ' : ' . $object->seniority_in_position . '<br>' : '');
$ret .= (dol_strlen($object->victim_skills) > 0 ? $langs->transnoentities('VictimSkills') . ' : ' . $object->victim_skills . '<br>' : '');
$ret .= (dol_strlen($object->collective_equipment) > 0 ? $langs->transnoentities('CollectiveEquipment') . ' : ' . $object->collective_equipment . '<br>' : '');
$ret .= (dol_strlen($object->individual_equipment) > 0 ? $langs->transnoentities('IndividualEquipment') . ' : ' . $object->individual_equipment . '<br>' : '');
$ret .= (dol_strlen($object->circumstances) > 0 ? $langs->transnoentities('Circumstances') . ' : ' . $object->circumstances . '<br>' : '');
$ret .= (dol_strlen($object->causality_tree) > 0 ? $langs->transnoentities('CausalityTree') . ' : ' . $object->causality_tree . '<br>' : '');

return $ret;
}
Expand Down
2 changes: 1 addition & 1 deletion class/actions_digiriskdolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function printCommonFooter($parameters)
$linkedAccidentList = '';
if (is_array($linkedAccidents) && !empty($linkedAccidents)) {
foreach ($linkedAccidents as $linkedAccident) {
$linkedAccidentList .= $linkedAccident->getNomUrl(1) . '</br>';
$linkedAccidentList .= $linkedAccident->getNomUrl(1) . '<br>';
}
}

Expand Down
4 changes: 2 additions & 2 deletions class/digiriskdocuments.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ public function getTriggerDescription(SaturneObject $object): string

$ret = parent::getTriggerDescription($object);

$ret .= $langs->transnoentities('ElementType') . ' : ' . $object->parent_type . '</br>';
$ret .= $langs->transnoentities('ParentElement') . ' : ' . $parentElement->ref . ' ' . $parentElement->label . '</br>';
$ret .= $langs->transnoentities('ElementType') . ' : ' . $object->parent_type . '<br>';
$ret .= $langs->transnoentities('ParentElement') . ' : ' . $parentElement->ref . ' ' . $parentElement->label . '<br>';
$ret .= $langs->transnoentities('LastMainDoc') . ' : ' . $object->last_main_doc . '<br>';

return $ret;
Expand Down
2 changes: 1 addition & 1 deletion class/preventionplan.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function getTriggerDescription(SaturneObject $object): string
$ret .= $langs->transnoentities('CSSCTIntervention') . ' : ' . ($object->cssct_intervention ? $langs->transnoentities("Yes") : $langs->transnoentities("No")) . '<br>';
$ret .= $langs->transnoentities('PriorVisit') . ' : ' . ($object->prior_visit_bool ? $langs->transnoentities("Yes") : $langs->transnoentities("No")) . '<br>';
if ($object->prior_visit_bool) {
$ret .= $langs->transnoentities('PriorVisitText') . ' : ' . (!empty($object->prior_visit_text) ? $object->prior_visit_text : 'N/A') . '</br>';
$ret .= $langs->transnoentities('PriorVisitText') . ' : ' . (!empty($object->prior_visit_text) ? $object->prior_visit_text : 'N/A') . '<br>';
$ret .= (dol_strlen($object->prior_visit_date) > 0 ? $langs->transnoentities('PriorVisitDate') . ' : ' . dol_print_date($object->prior_visit_date, 'dayhoursec') . '<br>' : '');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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('</br>', "\r\n", $actionComm->note));
$tmpArray['event_content'] = dol_htmlentitiesbr_decode($actionComm->note);
$tmpArray['date'] = dol_print_date($actionComm->datec, 'dayreduceformat');

$this->setTmpArrayVars($tmpArray, $listLines, $outputLangs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ class="risk-evaluation-cotation cotation"><?php echo $shownCotation; ?></div>
$digiriskElementIds = array_reverse($digiriskElementIds);

foreach ($digiriskElementIds as $key => $digiriskElementId) {
print str_repeat(' &#160', $key + 1) . '&#x21B3' . $activeDigiriskElementList[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '</br>';
print str_repeat(' &#160', $key + 1) . '&#x21B3' . $activeDigiriskElementList[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '<br>';
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
$digiriskElementIds = array_reverse($digiriskElementIds);

foreach ($digiriskElementIds as $key => $digiriskElementId) {
print str_repeat(' &#160', $key + 1) . '&#x21B3' . $alldigiriskelement[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '</br>';
print str_repeat(' &#160', $key + 1) . '&#x21B3' . $alldigiriskelement[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '<br>';
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion langs/fr_FR/digiriskdolibarr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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 </br> La nomenclature des conventions collectives provient de travail-emploi.gouv.fr
IDCCTooltip = Ce champ provient du module Digirisk pour Dolibarr <br> 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é
Expand Down
2 changes: 1 addition & 1 deletion public/ticket/create_ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
}
if ($entity > 0 && dolibarr_get_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 0) == 1) {
if ($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_VISIBLE) {
$selectDigiriskElement = '</br> <span ' . (($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? 'style="font-weight:600"' : '') . '>' . $langs->trans('Service') . (($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? '<span style="color:red"> *</span>' : '') . '</span>';
$selectDigiriskElement = '<br> <span ' . (($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? 'style="font-weight:600"' : '') . '>' . $langs->trans('Service') . (($conf->global->DIGIRISKDOLIBARR_TICKET_DIGIRISKELEMENT_REQUIRED) ? '<span style="color:red"> *</span>' : '') . '</span>';

$deletedElements = $digiriskelement->getMultiEntityTrashList();
if (empty($deletedElements)) {
Expand Down
6 changes: 3 additions & 3 deletions view/accidentinvestigation/accidentinvestigation_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
if ($resOne > 0 && $resTwo > 0) {
setEventMessages('AccidentInvestigationTaskCreated', []);
$task->fetch($result);
$description = $getNomResOne . '</br>' . $getNomResTwo;
$description = $getNomResOne . '<br>' . $getNomResTwo;
$task->setValueFrom('description', $description);
} else {
setEventMessages($task->error, [], 'errors');
Expand Down Expand Up @@ -243,7 +243,7 @@
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';

print '</table></br>';
print '</table><br>';

print dol_get_fiche_end();

Expand All @@ -270,7 +270,7 @@
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';

print '</table></br>';
print '</table><br>';

print dol_get_fiche_end();

Expand Down

0 comments on commit 4e1a212

Please sign in to comment.