From 9280ac8118ef2c47916bd72d6d86b1b3fba4d4ad Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Jan 2007 17:14:39 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20grisement=20des=20menus=20en=20fonction?= =?UTF-8?q?=20des=20droits=20Ajout=20des=20droits=20lire=20et=20cr=E9er=20?= =?UTF-8?q?sur=20les=20exports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menus/barre_left/eldy_backoffice.php | 4 +- .../menus/barre_top/eldy_backoffice.php | 37 +++++++++++++------ htdocs/includes/modules/modExport.class.php | 13 +++++++ 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 73033b80d7d..c7fe7acc8c7 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -676,8 +676,8 @@ class MenuLeft { if ($conf->export->enabled) { $langs->load("exports"); - $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("FormatedExport"),0,1); - $newmenu->add_submenu(DOL_URL_ROOT."/exports/export.php?leftmenu=export",$langs->trans("NewExport"),1,1); + $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("FormatedExport"),0, $user->rights->export->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/exports/export.php?leftmenu=export",$langs->trans("NewExport"),1, $user->rights->export->creer); } } diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index 4d9a78de4e7..bb46832f3c7 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -158,8 +158,11 @@ class MenuTop { { $class = 'class="tmenu"'; } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Suppliers").''; + + if ($user->rights->fournisseur->lire) + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Suppliers").''; + else + print ''.$langs->trans("Suppliers").''; } @@ -177,8 +180,11 @@ class MenuTop { { $class = 'class="tmenu"'; } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Commercial").''; + + if ($user->rights->commercial->lire) + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Commercial").''; + else + print ''.$langs->trans("Commercial").''; } @@ -197,8 +203,11 @@ class MenuTop { { $class = 'class="tmenu"'; } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuFinancial").''; + + if ($user->rights->compta->lire || $user->rights->comptaexpert->lire) + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuFinancial").''; + else + print ''.$langs->trans("MenuFinancial").''; } // Projets @@ -215,8 +224,11 @@ class MenuTop { { $class = 'class="tmenu"'; } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Projects").''; + + if ($user->rights->projet->lire) + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Projects").''; + else + print ''.$langs->trans("Projects").''; } // Tools @@ -234,9 +246,12 @@ class MenuTop { $class = 'class="tmenu"'; } - //print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; - //print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; + if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) + //print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; + //print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; + else + print ''.$langs->trans("Tools").''; } // OSCommerce 1 diff --git a/htdocs/includes/modules/modExport.class.php b/htdocs/includes/modules/modExport.class.php index e2c84403d34..c7ad14a1453 100644 --- a/htdocs/includes/modules/modExport.class.php +++ b/htdocs/includes/modules/modExport.class.php @@ -77,6 +77,19 @@ class modExport extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'export'; + + $this->rights[1][0] = 1201; + $this->rights[1][1] = 'Lire les exports'; + $this->rights[1][2] = 'r'; + $this->rights[1][3] = 1; + $this->rights[1][4] = 'lire'; + + $this->rights[2][0] = 1202; + $this->rights[2][1] = 'Créer/modifier un export'; + $this->rights[2][2] = 'w'; + $this->rights[2][3] = 0; + $this->rights[2][4] = 'creer'; + } /**