New: Numbering models with a suffix for specific country is visible only

if company is from this country.
This commit is contained in:
Laurent Destailleur 2013-07-26 15:17:36 +02:00
parent 5608e320f7
commit a386179f47

View File

@ -313,6 +313,10 @@ foreach ($dirmodels as $reldir)
$filebis = $file."/".$file.".modules.php";
$classname = "mod_facture_".$file;
}
// Check if there is a filter on country
preg_match('/\-(.*)_(.*)$/',$classname,$reg);
if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue;
$classname = preg_replace('/\-.*$/','',$classname);
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
{
@ -329,7 +333,7 @@ foreach ($dirmodels as $reldir)
{
$var = !$var;
print '<tr '.$bc[$var].'><td width="100">';
echo preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file));
echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file)));
print "</td><td>\n";
print $module->info();