New: Numbering models with a suffix for specific country is visible only
if company is from this country.
This commit is contained in:
parent
5608e320f7
commit
a386179f47
@ -313,6 +313,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
$filebis = $file."/".$file.".modules.php";
|
$filebis = $file."/".$file.".modules.php";
|
||||||
$classname = "mod_facture_".$file;
|
$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);
|
$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')
|
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;
|
$var = !$var;
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
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 "</td><td>\n";
|
||||||
|
|
||||||
print $module->info();
|
print $module->info();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user