Reload of menu auguria done when required
This commit is contained in:
parent
28ae602b7e
commit
e257da6b19
@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
|
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
|
$cancel=GETPOST('cancel','alpha');
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
@ -62,22 +63,22 @@ error_reporting($err);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'update' && empty($_POST["cancel"]))
|
if ($action == 'update' && ! $cancel)
|
||||||
{
|
{
|
||||||
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
|
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", $_POST["MAIN_MENU_SMARTPHONE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", $_POST["MAIN_MENUFRONT_STANDARD"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE",$_POST["MAIN_MENUFRONT_SMARTPHONE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
// Define list of menu handlers to initialize
|
// Define list of menu handlers to initialize
|
||||||
$listofmenuhandler=array();
|
$listofmenuhandler=array();
|
||||||
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENU_STANDARD"])]=1;
|
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_STANDARD','alpha'))]=1;
|
||||||
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENUFRONT_STANDARD"])]=1;
|
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_STANDARD','alpha'))]=1;
|
||||||
if (isset($_POST["MAIN_MENU_SMARTPHONE"])) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENU_SMARTPHONE"])]=1;
|
if (GETPOST('MAIN_MENU_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_SMARTPHONE','alpha'))]=1;
|
||||||
if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1;
|
if (GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'))]=1;
|
||||||
|
|
||||||
// Initialize menu handlers
|
// Initialize menu handlers
|
||||||
foreach ($listofmenuhandler as $key => $val)
|
foreach ($listofmenuhandler as $key => $val)
|
||||||
@ -179,7 +180,7 @@ if ($action == 'edit')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Menu top
|
// Menu top
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled');
|
$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled');
|
||||||
@ -190,7 +191,7 @@ if ($action == 'edit')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Menu smartphone
|
// Menu smartphone
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled');
|
$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled');
|
||||||
@ -217,7 +218,7 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED));
|
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED));
|
||||||
@ -229,7 +230,7 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
print '<td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -4361,31 +4361,10 @@ function migrate_reload_menu($db,$langs,$conf,$versionto)
|
|||||||
|
|
||||||
// Define list of menu handlers to initialize
|
// Define list of menu handlers to initialize
|
||||||
$listofmenuhandler=array();
|
$listofmenuhandler=array();
|
||||||
|
if ($conf->global->MAIN_MENU_STANDARD == 'auguria_menu' || $conf->global->MAIN_MENU_SMARTPHONE == 'auguria_menu'
|
||||||
$versiontoarray=explode('.',$versionto);
|
|| $conf->global->MAIN_MENUFRONT_STANDARD == 'auguria_menu' || $conf->global->MAIN_MENUFRONT_SMARTPHONE == 'auguria_menu')
|
||||||
|
|
||||||
// Migration required when target version is between
|
|
||||||
$afterversionarray=explode('.','2.8.9');
|
|
||||||
$beforeversionarray=explode('.','2.9.9');
|
|
||||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
|
||||||
{
|
{
|
||||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
||||||
}
|
|
||||||
|
|
||||||
// Migration required when target version is between
|
|
||||||
$afterversionarray=explode('.','3.1.9');
|
|
||||||
$beforeversionarray=explode('.','3.2.9');
|
|
||||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
|
||||||
{
|
|
||||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
|
||||||
}
|
|
||||||
|
|
||||||
// Migration required when target version is between
|
|
||||||
$afterversionarray=explode('.','3.7.9');
|
|
||||||
$beforeversionarray=explode('.','4.0.9');
|
|
||||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
|
||||||
{
|
|
||||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($listofmenuhandler as $key => $val)
|
foreach ($listofmenuhandler as $key => $val)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user