FIX Menu scheduled jobs not visible on jmobile conf

This commit is contained in:
Laurent Destailleur 2018-06-19 13:10:13 +02:00
parent edd7499375
commit b364412a4a
4 changed files with 5 additions and 4 deletions

View File

@ -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');

View File

@ -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&amp;leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>');
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;

View File

@ -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

View File

@ -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