From ae060a7e18ec2c1c6a6c71ea92559dd0a28846e5 Mon Sep 17 00:00:00 2001 From: erics Date: Wed, 22 Dec 2004 20:27:10 +0000 Subject: [PATCH] =?UTF-8?q?passage=20en=20nouvelle=20version=20=3F=20j'ai?= =?UTF-8?q?=20recopi=C3=A9=20ce=20qu'il=20y=20a=20dans=20le=20module=20mod?= =?UTF-8?q?Facture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/includes/modules/modCommande.class.php | 38 ++++++++++++++----- .../includes/modules/modExpedition.class.php | 37 ++++++++++++++---- 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/htdocs/includes/modules/modCommande.class.php b/htdocs/includes/modules/modCommande.class.php index ca938ea03c0..d5d6db14ff7 100644 --- a/htdocs/includes/modules/modCommande.class.php +++ b/htdocs/includes/modules/modCommande.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Eric Seigne * * 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 @@ -89,15 +90,34 @@ class modCommande extends DolibarrModules { // Permissions $this->remove(); - - $sql = array( - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (80,'Tous les droits sur les commandes','commande','a',0);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (81,'Lire les commandes','commande','r',1);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (82,'Créer modifier les commandes','commande','w',0);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (84,'Valider les commandes','commande','d',0);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (89,'Supprimer les commandes','commande','d',0);", - ); - + + $this->rights[0][0] = 80; // id de la permission + $this->rights[0][1] = 'Tous les droits sur les commandes'; // libelle de la permission + $this->rights[0][2] = 'a'; // type de la permission (déprécié à ce jour) + $this->rights[0][3] = 0; // La permission est-elle une permission par défaut + + $this->rights[1][0] = 81; + $this->rights[1][1] = 'Lire les commandes'; + $this->rights[1][2] = 'r'; + $this->rights[1][3] = 1; + + $this->rights[2][0] = 82; + $this->rights[2][1] = 'Créer modifier les commandes'; + $this->rights[2][2] = 'w'; + $this->rights[2][3] = 0; + + $this->rights[3][0] = 84; + $this->rights[3][1] = 'Valider les commandes'; + $this->rights[3][2] = 'd'; + $this->rights[3][3] = 0; + + $this->rights[4][0] = 89; + $this->rights[4][1] = 'Supprimer les commandes'; + $this->rights[4][2] = 'd'; + $this->rights[4][3] = 0; + + $sql = array(); + return $this->_init($sql); } diff --git a/htdocs/includes/modules/modExpedition.class.php b/htdocs/includes/modules/modExpedition.class.php index 105f617e690..c87b4a45e77 100644 --- a/htdocs/includes/modules/modExpedition.class.php +++ b/htdocs/includes/modules/modExpedition.class.php @@ -86,14 +86,35 @@ class modExpedition extends DolibarrModules // Permissions $this->remove(); - $sql = array( - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (100,'Tous les droits sur les expeditions','expedition','a',0);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (101,'Lire les expeditions','expedition','r',1);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (102,'Créer modifier les expeditions','expedition','w',0);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (104,'Valider les expeditions','expedition','d',0);", - "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (109,'Supprimer les expeditions','expedition','d',0);", - ); - + $sql = array(); + + $this->rights[0][0] = 100; // id de la permission + $this->rights[0][1] = 'Tous les droits sur les expeditions'; // libelle de la permission + $this->rights[0][2] = 'a'; // type de la permission (déprécié à ce jour) + $this->rights[0][3] = 0; // La permission est-elle une permission par défaut + + $this->rights[1][0] = 101; + $this->rights[1][1] = 'Lire les expeditions'; + $this->rights[1][2] = 'r'; + $this->rights[1][3] = 1; + + $this->rights[2][0] = 102; + $this->rights[2][1] = 'Créer modifier les expeditions'; + $this->rights[2][2] = 'w'; + $this->rights[2][3] = 0; + + $this->rights[3][0] = 104; + $this->rights[3][1] = 'Valider les expeditions'; + $this->rights[3][2] = 'd'; + $this->rights[3][3] = 0; + + $this->rights[4][0] = 109; + $this->rights[4][1] = 'Supprimer les expeditions'; + $this->rights[4][2] = 'd'; + $this->rights[4][3] = 0; + + $sql = array(); + return $this->_init($sql); }