diff --git a/ChangeLog b/ChangeLog index d065830edb9..55e398c9bd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,12 @@ For developers: - New: Add option 'aZ' into GETPOST function to check parameters contains only a to z or A to Z characters. +WARNING: Following change may create regression for some external modules, but was necessary to make +Dolibarr better: + +- The deprecated way (with 4 parameters) to declare a new tab into a module descriptor file has been +removed. You must now use the 6 parameters way. See file modMyModule.class.php for example. + ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6054cfff399..906eb08dd81 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4330,30 +4330,37 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= if (verifCond($values[4])) { if ($values[3]) $langs->load($values[3]); + if (preg_match('/SUBSTITUTION_([^_]+)/i',$values[2],$reg)) + { + $substitutionarray=array(); + complete_substitutions_array($substitutionarray,$langs,$object); + $label=make_substitutions($reg[1], $substitutionarray); + } + else $label=$langs->trans($values[2]); + $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[5]), 1); - $head[$h][1] = $langs->trans($values[2]); + $head[$h][1] = $label; $head[$h][2] = str_replace('+','',$values[1]); $h++; } } - else if (count($values) == 5) // new declaration + else if (count($values) == 5) // deprecated { if ($values[0] != $type) continue; if ($values[3]) $langs->load($values[3]); + if (preg_match('/SUBSTITUTION_([^_]+)/i',$values[2],$reg)) + { + $substitutionarray=array(); + complete_substitutions_array($substitutionarray,$langs,$object); + $label=make_substitutions($reg[1], $substitutionarray); + } + else $label=$langs->trans($values[2]); + $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[4]), 1); - $head[$h][1] = $langs->trans($values[2]); + $head[$h][1] = $label; $head[$h][2] = str_replace('+','',$values[1]); $h++; } - else if (count($values) == 4) // old declaration, for backward compatibility - { - if ($values[0] != $type) continue; - if ($values[2]) $langs->load($values[2]); - $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[3]), 1); - $head[$h][1] = $langs->trans($values[1]); - $head[$h][2] = 'tab'.$values[1]; - $h++; - } } else if ($mode == 'remove' && preg_match('/^\-/',$values[1])) {