diff --git a/admin/config/riskassessmentdocument.php b/admin/config/riskassessmentdocument.php index a16240e36..95994471f 100644 --- a/admin/config/riskassessmentdocument.php +++ b/admin/config/riskassessmentdocument.php @@ -180,6 +180,11 @@ 'description' => 'SortRisksListingsByEvaluationDescription', 'code' => 'DIGIRISKDOLIBARR_SORT_LISTINGS_BY_COTATION', ], + 'AlternateListRiskParentView' => [ + 'name' => 'AlternateListRiskParentView', + 'description' => 'AlternateListRiskParentViewDescription', + 'code' => 'DIGIRISKDOLIBARR_ALTERNATE_LIST_RISK_PARENT_VIEW', + ], 'RiskDescriptionPrefill' => [ 'name' => 'RiskDescriptionPrefill', 'description' => 'RiskDescriptionPrefillDescription', diff --git a/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php b/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php index 718393275..276bd9703 100644 --- a/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php +++ b/core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php @@ -1179,8 +1179,22 @@ class="risk-evaluation-cotation cotation"> if ($key == 'status') print $risk->getLibStatut(5); elseif ($key == 'fk_element') { if (is_object($activeDigiriskElementList[$risk->fk_element])) { - print $activeDigiriskElementList[$risk->fk_element]->getNomUrl(1, 'blank', 0, '', -1, 1); - } + if (!getDolGlobalInt('DIGIRISKDOLIBARR_ALTERNATE_LIST_RISK_PARENT_VIEW')) { + print $activeDigiriskElementList[$risk->fk_element]->getNomUrl(1, 'blank', 0, '', -1, 1); + } else { + $digiriskElementIds = $activeDigiriskElementList[$risk->fk_element]->getBranch($risk->fk_element); + $count = 0; + + if (!empty($digiriskElementIds)) { + $digiriskElementIds = array_reverse($digiriskElementIds); + + foreach ($digiriskElementIds as $digiriskElementId) { + $count++; + print $count . ' - ' . $activeDigiriskElementList[$digiriskElementId]->getNomUrl(1, 'blank', 0, '', -1, 1) . '
'; + } + } + } + } } elseif ($key == 'category') { ?>