From da4cacaa5bd6bd670e41bd566f8aa2d48964005b Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Thu, 30 May 2024 15:00:27 +0200 Subject: [PATCH] #3917 [Tools] add: handle diffence between empty and 0 --- langs/fr_FR/digiriskdolibarr.lang | 1 + view/digirisktools.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/langs/fr_FR/digiriskdolibarr.lang b/langs/fr_FR/digiriskdolibarr.lang index 8d3a1f3cb..dc15609b7 100644 --- a/langs/fr_FR/digiriskdolibarr.lang +++ b/langs/fr_FR/digiriskdolibarr.lang @@ -1004,6 +1004,7 @@ RisksRepartitionByDigiriskElement = Répartition des risques par # Data - Donnée Environment = Environnement +Riskenvironmental = Risque environnemental RiskEnvironmentals = Risques environnementaux Riskenvironmentals = Risques environnementaux DigiriskElementRiskenvironmentalsList = Liste des risques environnementaux diff --git a/view/digirisktools.php b/view/digirisktools.php index eea0bfc4e..a68e77de9 100644 --- a/view/digirisktools.php +++ b/view/digirisktools.php @@ -792,7 +792,7 @@ if (is_array($_POST) && !empty($_POST)) { $errors = []; foreach($_POST as $key => $value) { - if (strstr($key, 'search_') && !empty($value) && $value >= 0 && $value <= count($dangerCategories)) { + if (strstr($key, 'search_') && dol_strlen($value) > 0 && $value >= 0 && $value <= count($dangerCategories)) { $riskId = trim($key, 'search_'); $risk->fetch($riskId); $result = $risk->setValueFrom('category', $value); @@ -979,6 +979,7 @@ print ''; print '' . $langs->trans('RiskCategory') . ''; print '' . $langs->trans('Risk') . ''; + print '' . $langs->trans('Type') . ''; print '' . $langs->trans('Description') . ''; print '' . $langs->trans('DigiriskElement') . ''; print ''; @@ -1020,14 +1021,15 @@ '; - print '' . $risk->getNomUrl(1) . ''; + print '' . $risk->getNomUrl(1, 'nolink') . ''; + print '' . $langs->trans(ucfirst($risk->type)) . ''; print '' . $risk->description . ''; print '' . $digiriskElement->getNomUrl(1, '', 0, '', -1, 1) . ''; $button = ''; } } else { print '' . $langs->trans('NoRiskToRepair') . ''; - print ''; + print ''; $button = '' . $langs->trans('RepairRisks') . ''; }