From e190b010d3aae2aa6c501d37003f6a921a36a924 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 3 Jan 2021 16:05:04 +0100 Subject: [PATCH 1/2] Fix dict contact type element list --- htdocs/core/lib/admin.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7b3d66f9003..1bae8d0224f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1382,7 +1382,14 @@ function complete_elementList_with_modules(&$elementList) if (!empty($objMod->module_parts['contactelement'])) { - $elementList[$objMod->name] = $langs->trans($objMod->name); + if(is_array($objMod->module_parts['contactelement'])) { + foreach ($objMod->module_parts['contactelement'] as $elem => $title) { + $elementList[$elem] = $langs->trans($title); + } + } + else { + $elementList[$objMod->name] = $langs->trans($objMod->name); + } } $j++; From bb22f2ccaf18b8f50abe25a9477ff1f8188a4320 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Jan 2021 12:02:41 +0100 Subject: [PATCH 2/2] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 1bae8d0224f..8fddc46cca3 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1380,14 +1380,12 @@ function complete_elementList_with_modules(&$elementList) $dirmod[$i] = $dir; //print "x".$modName." ".$orders[$i]."\n
"; - if (!empty($objMod->module_parts['contactelement'])) - { - if(is_array($objMod->module_parts['contactelement'])) { + if (!empty($objMod->module_parts['contactelement'])) { + if (is_array($objMod->module_parts['contactelement'])) { foreach ($objMod->module_parts['contactelement'] as $elem => $title) { $elementList[$elem] = $langs->trans($title); } - } - else { + } else { $elementList[$objMod->name] = $langs->trans($objMod->name); } }