From e35b8844a055255395add5b1d66657b79ece3049 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Jan 2007 00:47:56 +0000 Subject: [PATCH] Fix: Menu compta/treso a ne pas activer si module pas actif --- htdocs/includes/menus/barre_top/default.php | 3 ++- .../includes/menus/barre_top/eldy_backoffice.php | 2 +- .../includes/menus/barre_top/eldy_frontoffice.php | 2 +- htdocs/pre.inc.php | 15 ++++++--------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/includes/menus/barre_top/default.php b/htdocs/includes/menus/barre_top/default.php index 9be374b0b99..72708ea4af3 100644 --- a/htdocs/includes/menus/barre_top/default.php +++ b/htdocs/includes/menus/barre_top/default.php @@ -144,7 +144,8 @@ class MenuTop { } // Compta/tréso (sert pour banque, tva, entités à facturer...) - if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->caisse->enabled) + if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled + || $conf->commande->enabled || $conf->facture->enabled) { // if ($user->rights->compta->general->lire || $user->rights->comptaexpert->general->lire) // { diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index 82eb1630d83..4d9a78de4e7 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -183,7 +183,7 @@ class MenuTop { } // Financial - if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->caisse->enabled + if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->commande->enabled || $conf->facture->enabled) { $langs->load("compta"); diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php index 35dbb355b07..7701257dfe5 100644 --- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php @@ -183,7 +183,7 @@ class MenuTop { } // Financial - if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->caisse->enabled + if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->commande->enabled || $conf->facture->enabled) { $langs->load("compta"); diff --git a/htdocs/pre.inc.php b/htdocs/pre.inc.php index dd63140c76c..b394df7db9d 100644 --- a/htdocs/pre.inc.php +++ b/htdocs/pre.inc.php @@ -32,7 +32,8 @@ require ("./main.inc.php"); $user->getrights(); -function llxHeader($head = "") { +function llxHeader($head = "") +{ global $user, $conf, $langs; top_menu($head); @@ -56,7 +57,7 @@ function llxHeader($head = "") { $menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); } - if ($conf->commercial->enabled && $user->rights->commercial->lire) + if ($conf->commercial->enabled && $user->rights->commercial->lire) { $langs->load("commercial"); $menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial")); @@ -71,12 +72,8 @@ function llxHeader($head = "") { } } -// L'espace compta/tréso doit toujours etre actif car c'est un espace partagé -// par de nombreux modules (banque, facture, commande à facturer, etc...) indépendemment -// de l'utilisation de la compta ou non. C'est au sein de cet espace que chaque sous fonction -// est protégé par le droit qui va bien du module concerné. -// if ($conf->compta->enabled || $conf->comptaexpert->enabled) -// { + if ($conf->compta->enabled || $conf->comptaexpert->enabled) + { $langs->load("compta"); $menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("MenuFinancial")); @@ -84,7 +81,7 @@ function llxHeader($head = "") { $langs->load("bills"); $menu->add_submenu(DOL_URL_ROOT."/compta/facture.php", $langs->trans("Bills")); } -// } + } if ($conf->fichinter->enabled && $user->rights->ficheinter->lire) {