Fix: add function for switch to another entity
This commit is contained in:
parent
255e1fdedf
commit
d8937157bf
@ -769,16 +769,19 @@ else
|
|||||||
$heightforframes=48;
|
$heightforframes=48;
|
||||||
|
|
||||||
// Switch to another entity
|
// Switch to another entity
|
||||||
if (GETPOST('action') == 'switchentity' && $user->admin && ! $user->entity)
|
if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY))
|
||||||
{
|
{
|
||||||
require_once("../class/actions_multicompany.class.php");
|
if (GETPOST('action') == 'switchentity' && $user->admin && ! $user->entity)
|
||||||
|
|
||||||
$mc = new ActionsMulticompany($db);
|
|
||||||
|
|
||||||
if($mc->switchEntity(GETPOST('entity_id')) > 0)
|
|
||||||
{
|
{
|
||||||
Header("Location: ".DOL_URL_ROOT.'/');
|
require_once("../class/actions_multicompany.class.php");
|
||||||
exit;
|
|
||||||
|
$mc = new ActionsMulticompany($db);
|
||||||
|
|
||||||
|
if($mc->switchEntity(GETPOST('entity_id')) > 0)
|
||||||
|
{
|
||||||
|
Header("Location: ".DOL_URL_ROOT.'/');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user