Fix: add function for switch to another entity

This commit is contained in:
Regis Houssin 2011-04-01 09:53:41 +00:00
parent 255e1fdedf
commit d8937157bf

View File

@ -769,8 +769,10 @@ 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))
{ {
if (GETPOST('action') == 'switchentity' && $user->admin && ! $user->entity)
{
require_once("../class/actions_multicompany.class.php"); require_once("../class/actions_multicompany.class.php");
$mc = new ActionsMulticompany($db); $mc = new ActionsMulticompany($db);
@ -780,6 +782,7 @@ if (GETPOST('action') == 'switchentity' && $user->admin && ! $user->entity)
Header("Location: ".DOL_URL_ROOT.'/'); Header("Location: ".DOL_URL_ROOT.'/');
exit; exit;
} }
}
} }