From 258df5ff21996c8b9f8844fbe5756d081e3e9374 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Dec 2005 11:20:32 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20permissions=20sur=20cr=E9ation=20et=20s?= =?UTF-8?q?uppression=20des=20contacts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/contact/fiche.php | 12 +++++++++--- htdocs/includes/modules/modSociete.class.php | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 55621d22531..100e85ecd24 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -471,15 +471,21 @@ elseif ($_GET["id"]) if (! $user->societe_id) { print '
'; - + + if ($user->rights->societe->contact->creer) + { print ''.$langs->trans('Edit').''; + } if (! $contact->user_id && $user->admin) { print ''.$langs->trans("CreateDolibarrLogin").''; } - - print ''.$langs->trans('Delete').''; + + if ($user->rights->societe->contact->supprimer) + { + print ''.$langs->trans('Delete').''; + } print "

"; } diff --git a/htdocs/includes/modules/modSociete.class.php b/htdocs/includes/modules/modSociete.class.php index fd3f4d9f0e2..0963dbd1001 100644 --- a/htdocs/includes/modules/modSociete.class.php +++ b/htdocs/includes/modules/modSociete.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,6 +100,20 @@ class modSociete extends DolibarrModules $this->rights[3][2] = 'd'; // type de la permission (déprécié à ce jour) $this->rights[3][3] = 0; // La permission est-elle une permission par défaut $this->rights[3][4] = 'supprimer'; + + $this->rights[4][0] = 261; // id de la permission + $this->rights[4][1] = 'Créer modifier les contacts'; // libelle de la permission + $this->rights[4][2] = 'w'; // type de la permission (déprécié à ce jour) + $this->rights[4][3] = 0; // La permission est-elle une permission par défaut + $this->rights[4][4] = 'contact'; + $this->rights[4][5] = 'creer'; + + $this->rights[5][0] = 262; // id de la permission + $this->rights[5][1] = 'Supprimer les contacts'; // libelle de la permission + $this->rights[5][2] = 'd'; // type de la permission (déprécié à ce jour) + $this->rights[5][3] = 0; // La permission est-elle une permission par défaut + $this->rights[5][4] = 'contact'; + $this->rights[5][5] = 'supprimer'; }