From b364412a4acb05a685452159c8ed161a222ab09f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Jun 2018 13:10:13 +0200 Subject: [PATCH] FIX Menu scheduled jobs not visible on jmobile conf --- htdocs/core/get_menudiv.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/menus/standard/eldy_menu.php | 3 ++- htdocs/core/modules/modCron.class.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 3b49482a217..ef870095325 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -203,7 +203,7 @@ if (! class_exists('MenuManager')) } } $menumanager = new MenuManager($db, empty($user->societe_id)?0:1); -$menumanager->loadMenu('all','all'); +$menumanager->loadMenu('all','all'); // Load this->tabMenu with sql menu entries //var_dump($menumanager);exit; $menumanager->showmenu('jmobile'); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 448d3d4870c..6d244f8d748 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -525,6 +525,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Setup $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', ''); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="setup") { $langs->load("admin"); @@ -1581,7 +1582,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } - // Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after //var_dump($menu_array_before);exit; //var_dump($menu_array_after);exit; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index f81d7d36c72..11f1de43a1f 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -111,7 +111,8 @@ class MenuManager /** - * Show menu + * Show menu. + * Module defined in sql tables are stored into this->tabMenu BEFORE this is called. * * @param string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu) * @param array $moredata An array with more data to output diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 9ffe92699d7..31d27abac0b 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -137,7 +137,7 @@ class modCron extends DolibarrModules 'url'=>'/cron/list.php?status=-2&leftmenu=admintools', 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>200, - 'enabled'=>'$conf->cron->enabled && preg_match(\'/^admintools/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both