FIX Warning for some country must appears if company is in this country.

This commit is contained in:
Laurent Destailleur 2020-01-01 22:26:47 +01:00
parent 2e8fd25299
commit d3d7592072

View File

@ -825,12 +825,15 @@ if ($mode == 'common')
$warningmessage = ''; $warningmessage = '';
if (!empty($arrayofwarnings[$modName])) if (!empty($arrayofwarnings[$modName]))
{ {
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n"; print '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
{
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
{ {
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code); $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
} }
} }
}
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext)) if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
{ {
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n"; print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";