Merge pull request #5237 from EuskalMoneta/bug-5236

FIX #5236 Cron module activated but "Modules tools" does not appear in the left menu.
This commit is contained in:
Laurent Destailleur 2016-05-22 19:31:42 +02:00
commit 9b5dc9da3c
2 changed files with 5 additions and 3 deletions

View File

@ -110,7 +110,8 @@ class MenuManager
// Modules system tools
// TODO Find a way to add parent menu only if child menu exists. For the moment, no other method than hard coded methods.
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on
// TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) || ! empty($conf->cron->enabled)
|| ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS))
{
if (empty($user->societe_id))

View File

@ -544,14 +544,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
}
// Modules system tools
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on
// TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) || ! empty($conf->cron->enabled)
|| ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS)) // Some external modules may need to force to have this entry on.
{
if (empty($user->societe_id))
{
$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ModulesSystemTools"), 0, $user->admin, '', $mainmenu, 'modulesadmintools');
// Special case: This entry can't be embedded into modules because we need it for both module service and products and we don't want duplicate lines.
if ((empty($leftmenu) || $leftmenu=="modulesadmintools") && $user->admin)
if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && (empty($leftmenu) || $leftmenu=="modulesadmintools") && $user->admin)
{
$langs->load("products");
$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);