Fix: verify if multicompany is enabled and entity is active
This commit is contained in:
parent
0f848aabd7
commit
0cfb959d3d
@ -112,6 +112,7 @@ class Conf
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$numr = $db->num_rows($result);
|
$numr = $db->num_rows($result);
|
||||||
|
$multicompany_sharing=array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $numr)
|
while ($i < $numr)
|
||||||
@ -187,15 +188,26 @@ class Conf
|
|||||||
// Sharings between entities
|
// Sharings between entities
|
||||||
else if ($value && preg_match('/^MULTICOMPANY_([A-Z_]+)_SHARING$/',$key,$reg))
|
else if ($value && preg_match('/^MULTICOMPANY_([A-Z_]+)_SHARING$/',$key,$reg))
|
||||||
{
|
{
|
||||||
dol_include_once('/multicompany/class/actions_multicompany.class.php');
|
|
||||||
$mc = new ActionsMulticompany($db);
|
|
||||||
$module=strtolower($reg[1]);
|
$module=strtolower($reg[1]);
|
||||||
$mc->getEntitySharing($module);
|
$multicompany_sharing[$module]=$value;
|
||||||
$this->entities[$module]=$mc->entities;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
// Sharings between entities
|
||||||
|
if ($this->multicompany->enabled)
|
||||||
|
{
|
||||||
|
dol_include_once('/multicompany/class/actions_multicompany.class.php');
|
||||||
|
$mc = new ActionsMulticompany($db);
|
||||||
|
|
||||||
|
foreach($multicompany_sharing as $key => $value)
|
||||||
|
{
|
||||||
|
$this->entities[$key]=$mc->check_entity($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
//var_dump($this->modules);
|
//var_dump($this->modules);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user