Removed old constant name for menu management.

This commit is contained in:
Laurent Destailleur 2011-02-13 13:22:54 +00:00
parent 2c052558c9
commit 684eddf9fe
7 changed files with 23 additions and 17 deletions

View File

@ -62,16 +62,16 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can
{ {
$_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_BARRETOP", $_POST["main_menu_barretop"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'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", $_POST["main_menu_smartphone"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENUFRONT_BARRETOP", $_POST["main_menufront_barretop"],'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_SMARTPHONE",$_POST["main_menufront_smartphone"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE",$_POST["main_menufront_smartphone"],'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('/((_back|_front)office)?\.php/i','',$_POST["main_menu_barretop"])]=1; $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENU_STANDARD"])]=1;
$listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menufront_barretop"])]=1; $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_STANDARD"])]=1;
if (isset($_POST["main_menu_smartphone"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menu_smartphone"])]=1; if (isset($_POST["main_menu_smartphone"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menu_smartphone"])]=1;
if (isset($_POST["main_menufront_smartphone"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menufront_smartphone"])]=1; if (isset($_POST["main_menufront_smartphone"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menufront_smartphone"])]=1;
@ -156,10 +156,10 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>';
print '<td>'; print '<td>';
print $htmladmin->select_menu($conf->global->MAIN_MENU_BARRETOP,'main_menu_barretop',$dirtop); print $htmladmin->select_menu($conf->global->MAIN_MENU_STANDARD,'MAIN_MENU_STANDARD',$dirtop);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print $htmladmin->select_menu($conf->global->MAIN_MENUFRONT_BARRETOP,'main_menufront_barretop',$dirtop); print $htmladmin->select_menu($conf->global->MAIN_MENUFRONT_STANDARD,'MAIN_MENUFRONT_STANDARD',$dirtop);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -205,11 +205,11 @@ else
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>';
print '<td>'; print '<td>';
$filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENU_BARRETOP); $filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENU_STANDARD);
print $filelib; print $filelib;
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENUFRONT_BARRETOP); $filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENUFRONT_STANDARD);
print $filelib; print $filelib;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -43,7 +43,7 @@ $dirmenu = array($dirleft,$dirsmartphone);
$mesg=$_GET["mesg"]; $mesg=$_GET["mesg"];
$menu_handler_top=$conf->global->MAIN_MENU_BARRETOP; $menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
$menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top); $menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top);
$menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top); $menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top);

View File

@ -43,7 +43,7 @@ $dirmenu = array($dirleft,$dirsmartphone);
$mesg=$_GET["mesg"]; $mesg=$_GET["mesg"];
$menu_handler_top=$conf->global->MAIN_MENU_BARRETOP; $menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
$menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top); $menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top);
$menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top); $menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top);

View File

@ -60,10 +60,8 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_BARRETOP','eldy_backoffice.php','chaine','Module de gestion de la barre de menu pour utilisateurs internes',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_STANDARD','eldy_backoffice.php','chaine','Module de gestion de la barre de menu pour utilisateurs internes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_BARRETOP','eldy_frontoffice.php','chaine','Module de gestion de la barre de menu pour utilisateurs externes',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_STANDARD','eldy_frontoffice.php','chaine','Module de gestion de la barre de menu pour utilisateurs externes',0);
--insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_BARRELEFT','eldy_backoffice.php','chaine','Module de gestion de la barre de menu gauche pour utilisateurs internes',0);
--insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_BARRELEFT','eldy_frontoffice.php','chaine','Module de gestion de la barre de menu gauche pour utilisateurs externes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_SMARTPHONE','iphone_backoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs internes',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_SMARTPHONE','iphone_backoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs internes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_SMARTPHONE','iphone_frontoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs externes',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_SMARTPHONE','iphone_frontoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs externes',0);

View File

@ -11,3 +11,11 @@
-- --
ALTER TABLE llx_c_actioncomm add COLUMN position integer NOT NULL DEFAULT 0; ALTER TABLE llx_c_actioncomm add COLUMN position integer NOT NULL DEFAULT 0;
-- Delete old constants
DELETE from llx_const where NAME = 'MAIN_MENU_BARRETOP';
DELETE from llx_const where NAME = 'MAIN_MENUFRONT_BARRETOP';
DELETE from llx_const where NAME = 'MAIN_MENU_BARRELEFT';
DELETE from llx_const where NAME = 'MAIN_MENUFRONT_BARRELEFT';

View File

@ -669,7 +669,7 @@ if (! empty($_GET["theme"]))
// Define menu manager to use // Define menu manager to use
if (empty($user->societe_id)) // If internal user or not defined if (empty($user->societe_id)) // If internal user or not defined
{ {
$conf->top_menu=$conf->global->MAIN_MENU_BARRETOP; $conf->top_menu=$conf->global->MAIN_MENU_STANDARD;
$conf->smart_menu=$conf->global->MAIN_MENU_SMARTPHONE; $conf->smart_menu=$conf->global->MAIN_MENU_SMARTPHONE;
// For backward compatibility // For backward compatibility
if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php'; if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php';
@ -677,7 +677,7 @@ if (empty($user->societe_id)) // If internal user or not defined
} }
else // If external user else // If external user
{ {
$conf->top_menu=$conf->global->MAIN_MENUFRONT_BARRETOP; $conf->top_menu=$conf->global->MAIN_MENUFRONT_STANDARD;
$conf->smart_menu=$conf->global->MAIN_MENUFRONT_SMARTPHONE; $conf->smart_menu=$conf->global->MAIN_MENUFRONT_SMARTPHONE;
// For backward compatibility // For backward compatibility
if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_frontoffice.php'; if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_frontoffice.php';

View File

@ -92,7 +92,7 @@ if ($_POST["action"] == 'update' && ($caneditfield || $user->admin))
if ($_POST["check_MAIN_LANG_DEFAULT"]=="on") $tabparam["MAIN_LANG_DEFAULT"]=$_POST["main_lang_default"]; if ($_POST["check_MAIN_LANG_DEFAULT"]=="on") $tabparam["MAIN_LANG_DEFAULT"]=$_POST["main_lang_default"];
else $tabparam["MAIN_LANG_DEFAULT"]=''; else $tabparam["MAIN_LANG_DEFAULT"]='';
$tabparam["MAIN_MENU_BARRETOP"]=$_POST["main_menu_barretop"]; $tabparam["MAIN_MENU_STANDARD"]=$_POST["MAIN_MENU_STANDARD"];
if ($_POST["check_SIZE_LISTE_LIMIT"]=="on") $tabparam["MAIN_SIZE_LISTE_LIMIT"]=$_POST["main_size_liste_limit"]; if ($_POST["check_SIZE_LISTE_LIMIT"]=="on") $tabparam["MAIN_SIZE_LISTE_LIMIT"]=$_POST["main_size_liste_limit"];
else $tabparam["MAIN_SIZE_LISTE_LIMIT"]=''; else $tabparam["MAIN_SIZE_LISTE_LIMIT"]='';