Qual: Modification du code pour que la gestion de droits fonctionne partout avec le nouveau systme (champ perms et subperms). Suppression ancienne mthode.

This commit is contained in:
Laurent Destailleur 2005-02-16 21:27:45 +00:00
parent 917bfceee6
commit 6ad1ff2c08
15 changed files with 164 additions and 265 deletions

View File

@ -136,21 +136,25 @@ class modAdherent extends DolibarrModules
$this->rights[1][1] = 'Lire les fiche adherents'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 72; // id de la permission
$this->rights[2][1] = 'Créer modifier des adherents'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 73; // id de la permission
$this->rights[3][1] = 'Modifier les adherents'; // libelle de la permission
$this->rights[3][2] = 'm'; // 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] = 'modifier';
$this->rights[4][0] = 74; // id de la permission
$this->rights[4][1] = 'Supprimer les adherents'; // libelle de la permission
$this->rights[4][2] = 'd'; // 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] = 'supprimer';
// Dir
$this->dirs[0] = $conf->adherent->dir_output;

View File

@ -93,16 +93,19 @@ class modBanque extends DolibarrModules
$this->rights[1][1] = 'Lire les comptes bancaires'; // libelle de la permission
$this->rights[1][2] = 'a'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 0; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 112; // id de la permission
$this->rights[2][1] = 'Créer modifier rapprocher transactions'; // libelle de la permission
$this->rights[2][2] = 'a'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'modifier';
$this->rights[3][0] = 113; // id de la permission
$this->rights[3][1] = 'Configurer les comptes bancaires (créer, gérer catégories)'; // libelle de la permission
$this->rights[3][2] = 'a'; // 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] = 'configurer';
$sql = array();

View File

@ -103,21 +103,25 @@ class modCommande extends DolibarrModules
$this->rights[1][1] = 'Lire les commandes';
$this->rights[1][2] = 'r';
$this->rights[1][3] = 1;
$this->rights[1][4] = 'lire';
$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[2][4] = 'creer';
$this->rights[3][0] = 84;
$this->rights[3][1] = 'Valider les commandes';
$this->rights[3][2] = 'd';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'valider';
$this->rights[4][0] = 89;
$this->rights[4][1] = 'Supprimer les commandes';
$this->rights[4][2] = 'd';
$this->rights[4][3] = 0;
$this->rights[4][4] = 'supprimer';
// Dir
$this->dirs[0] = $conf->commande->dir_output;

View File

@ -98,31 +98,43 @@ class modComptabilite extends DolibarrModules
$this->rights[1][1] = 'Lire les charges';
$this->rights[1][2] = 'r';
$this->rights[1][3] = 1;
$this->rights[1][4] = 'charges';
$this->rights[1][5] = 'lire';
$this->rights[2][0] = 92;
$this->rights[2][1] = 'Créer modifier les charges';
$this->rights[2][2] = 'w';
$this->rights[2][3] = 0;
$this->rights[2][4] = 'charges';
$this->rights[2][5] = 'creer';
$this->rights[3][0] = 93;
$this->rights[3][1] = 'Supprimer les charges';
$this->rights[3][2] = 'd';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'charges';
$this->rights[3][5] = 'supprimer';
$this->rights[4][0] = 95;
$this->rights[4][1] = 'Lire CA, bilans, résultats';
$this->rights[4][2] = 'r';
$this->rights[4][3] = 1;
$this->rights[4][4] = 'resultat';
$this->rights[4][5] = 'lire';
$this->rights[5][0] = 96;
$this->rights[5][1] = 'Paramétrer la ventilation';
$this->rights[5][2] = 'r';
$this->rights[5][3] = 0;
$this->rights[5][4] = 'ventilation';
$this->rights[5][5] = 'parametrer';
$this->rights[6][0] = 97;
$this->rights[6][1] = 'Ventiler les lignes de facture';
$this->rights[6][2] = 'r';
$this->rights[6][3] = 0;
$this->rights[6][4] = 'ventilation';
$this->rights[6][5] = 'creer';
// Dir
$this->dirs[0] = $conf->compta->dir_output;

View File

@ -93,21 +93,25 @@ class modContrat extends DolibarrModules
$this->rights[1][1] = 'Consulter les contrats';
$this->rights[1][2] = 'r';
$this->rights[1][3] = 1;
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 162;
$this->rights[2][1] = 'Créer / modifier les contrats';
$this->rights[2][2] = 'r';
$this->rights[2][3] = 0;
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 163;
$this->rights[3][1] = 'Activer les services des contrats';
$this->rights[3][1] = 'Activer les contrats de services';
$this->rights[3][2] = 'r';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'activer';
$this->rights[4][0] = 164;
$this->rights[4][1] = 'Désactiver les services des contrats';
$this->rights[4][1] = 'Désactiver les contrats de services';
$this->rights[4][2] = 'r';
$this->rights[4][3] = 0;
$this->rights[4][4] = 'desactiver';
$sql = array();

View File

@ -96,21 +96,25 @@ class modExpedition extends DolibarrModules
$this->rights[1][1] = 'Lire les expeditions';
$this->rights[1][2] = 'r';
$this->rights[1][3] = 1;
$this->rights[1][4] = 'lire';
$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[2][4] = 'creer';
$this->rights[3][0] = 104;
$this->rights[3][1] = 'Valider les expeditions';
$this->rights[3][2] = 'd';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'valider';
$this->rights[4][0] = 109;
$this->rights[4][1] = 'Supprimer les expeditions';
$this->rights[4][2] = 'd';
$this->rights[4][3] = 0;
$this->rights[4][4] = 'supprimer';
$sql = array();

View File

@ -141,31 +141,37 @@ class modFacture extends DolibarrModules
$this->rights[1][1] = 'Consulter les factures';
$this->rights[1][2] = 'a';
$this->rights[1][3] = 0;
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 12;
$this->rights[2][1] = 'Créer/modifier les factures';
$this->rights[2][2] = 'a';
$this->rights[2][3] = 0;
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 14;
$this->rights[3][1] = 'Valider les factures';
$this->rights[3][2] = 'a';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'valider';
$this->rights[4][0] = 15;
$this->rights[4][1] = 'Envoyer les factures aux clients';
$this->rights[4][2] = 'a';
$this->rights[4][3] = 0;
$this->rights[4][4] = 'envoyer';
$this->rights[5][0] = 16;
$this->rights[5][1] = 'Emettre des paiements sur les factures';
$this->rights[5][2] = 'a';
$this->rights[5][3] = 0;
$this->rights[5][4] = 'paiement';
$this->rights[6][0] = 19;
$this->rights[6][1] = 'Supprimer les factures';
$this->rights[6][2] = 'a';
$this->rights[6][3] = 0;
$this->rights[6][4] = 'supprimer';
// Dir
$this->dirs[0] = $conf->facture->dir_output;

View File

@ -99,16 +99,25 @@ class modProduit extends DolibarrModules
$this->rights[1][1] = 'Lire les produits/services'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 32; // id de la permission
$this->rights[2][1] = 'Créer modifier les produits/services'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 34; // id de la permission
$this->rights[3][1] = 'Supprimer les produits/services'; // libelle de la permission
$this->rights[3][2] = 'd'; // type de la permission (déprécié à ce jour)
$this->rights[3][0] = 33; // id de la permission
$this->rights[3][1] = 'Commander les produits/services'; // libelle de la permission
$this->rights[3][2] = 'w'; // 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] = 'commander';
$this->rights[4][0] = 34; // id de la permission
$this->rights[4][1] = 'Supprimer les produits/services'; // libelle de la permission
$this->rights[4][2] = 'd'; // 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] = 'supprimer';
$sql = array();

View File

@ -91,16 +91,19 @@ class modProjet extends DolibarrModules
$this->rights[1][1] = 'Lire les projets'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 42; // id de la permission
$this->rights[2][1] = 'Créer modifier les projets'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 44; // id de la permission
$this->rights[3][1] = 'Supprimer les projets'; // libelle de la permission
$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';
return $this->_init($sql);
}

View File

@ -110,32 +110,37 @@ class modPropale extends DolibarrModules
$this->rights[1][1] = 'Lire les propositions commerciales'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 22; // id de la permission
$this->rights[2][1] = 'Créer modifier les propositions commerciales'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 24; // id de la permission
$this->rights[3][1] = 'Valider les propositions commerciales'; // libelle de la permission
$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] = 'valider';
$this->rights[4][0] = 25; // id de la permission
$this->rights[4][1] = 'Envoyer les propositions commerciales aux clients'; // libelle de la permission
$this->rights[4][2] = 'd'; // 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] = 'envoyer';
$this->rights[5][0] = 26; // id de la permission
$this->rights[5][1] = 'Clôturer les propositions commerciales'; // 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] = 'cloturer';
$this->rights[6][0] = 27; // id de la permission
$this->rights[6][1] = 'Supprimer les propositions commerciales'; // libelle de la permission
$this->rights[6][2] = 'd'; // type de la permission (déprécié à ce jour)
$this->rights[6][3] = 0; // La permission est-elle une permission par défaut
$this->rights[6][4] = 'supprimer';
$sql = array(

View File

@ -96,16 +96,25 @@ class modService extends DolibarrModules
$this->rights[1][1] = 'Lire les produits/services'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 32; // id de la permission
$this->rights[2][1] = 'Créer modifier les produits/services'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 34; // id de la permission
$this->rights[3][1] = 'Supprimer les produits/services'; // libelle de la permission
$this->rights[3][2] = 'd'; // type de la permission (déprécié à ce jour)
$this->rights[3][0] = 33; // id de la permission
$this->rights[3][1] = 'Commander les produits/services'; // libelle de la permission
$this->rights[3][2] = 'w'; // 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] = 'commander';
$this->rights[4][0] = 34; // id de la permission
$this->rights[4][1] = 'Supprimer les produits/services'; // libelle de la permission
$this->rights[4][2] = 'd'; // 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] = 'supprimer';
$sql = array();

View File

@ -98,16 +98,19 @@ class modSociete extends DolibarrModules
$this->rights[1][1] = 'Lire les societes'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 122; // id de la permission
$this->rights[2][1] = 'Créer modifier les societes'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 129; // id de la permission
$this->rights[3][1] = 'Supprimer les sociétés'; // libelle de la permission
$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';
// Dir
$this->dirs[0] = $conf->societe->dir_output;

View File

@ -93,17 +93,20 @@ class modTelephonie extends DolibarrModules
$this->rights[1][0] = 141; // id de la permission
$this->rights[1][1] = 'Consulter la telephonie'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[1][3] = 0; // La permission est-elle une permission par défaut
$this->rights[1][3] = 1; // La permission est-elle une permission par défaut
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 142; // id de la permission
$this->rights[2][1] = 'Commander les lignes'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par défaut
$this->rights[2][4] = 'ligne_commander';
$this->rights[3][0] = 143; // id de la permission
$this->rights[3][1] = 'Activer une ligne'; // libelle de la permission
$this->rights[3][2] = 'w'; // 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] = 'ligne_activer';
$this->rights[4][0] = 144; // id de la permission
$this->rights[4][1] = 'Configurer la telephonie'; // libelle de la permission

View File

@ -248,266 +248,14 @@ class User
function getrights($module='')
{
if ($this->all_permissions_are_loaded) {
if ($this->all_permissions_are_loaded)
{
// Si les permissions ont déja été chargé pour ce user, on quitte
// Cela évite de faire n fois le select quand la fonction est appelée plusieurs fois
// pour charger les droits de différents modules. On les charges tous la
// première fois, puis on ne fait plus rien.
return;
}
/*
* Ancienne méthode
* Ne pas supprimer tant que tous les modules n'ont pas été migrés !
*
*/
$sql = "SELECT u.fk_user, u.fk_id";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as u, ".MAIN_DB_PREFIX."rights_def as r";
$sql .= " WHERE r.id = u.fk_id AND u.fk_user= $this->id AND r.perms IS NULL";
if ($this->db->query($sql))
{
$num = $this->db->num_rows();
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object();
if ($module == 'facture' or $module == '')
{
if ($obj->fk_id == 11)
$this->rights->facture->lire = 1;
if ($obj->fk_id == 12)
$this->rights->facture->creer = 1;
if ($obj->fk_id == 13)
$this->rights->facture->modifier = 1;
if ($obj->fk_id == 14)
$this->rights->facture->valider = 1;
if ($obj->fk_id == 15)
$this->rights->facture->envoyer = 1;
if ($obj->fk_id == 16)
$this->rights->facture->paiement = 1;
if ($obj->fk_id == 19)
$this->rights->facture->supprimer = 1;
}
if ($module == 'propale' or $module == '')
{
if ($obj->fk_id == 21)
$this->rights->propale->lire = 1;
if ($obj->fk_id == 22)
$this->rights->propale->creer = 1;
if ($obj->fk_id == 23)
$this->rights->propale->modifier = 1;
if ($obj->fk_id == 24)
$this->rights->propale->valider = 1;
if ($obj->fk_id == 25)
$this->rights->propale->envoyer = 1;
if ($obj->fk_id == 26)
$this->rights->propale->cloturer = 1;
if ($obj->fk_id == 27)
$this->rights->propale->supprimer = 1;
}
if ($module == 'produit' or $module == '')
{
if ($obj->fk_id == 31)
$this->rights->produit->lire = 1;
if ($obj->fk_id == 32)
$this->rights->produit->creer = 1;
if ($obj->fk_id == 33)
$this->rights->produit->commander = 1;
if ($obj->fk_id == 34)
$this->rights->produit->supprimer = 1;
}
if ($module == 'projet' or $module == '')
{
if ($obj->fk_id == 41)
$this->rights->projet->lire = 1;
if ($obj->fk_id == 42)
$this->rights->projet->creer = 1;
if ($obj->fk_id == 43)
$this->rights->projet->modifier = 1;
if ($obj->fk_id == 44)
$this->rights->projet->supprimer = 1;
}
if ($module == 'commande' or $module == '')
{
if ($obj->fk_id == 81)
$this->rights->commande->lire = 1;
if ($obj->fk_id == 82)
$this->rights->commande->creer = 1;
if ($obj->fk_id == 84)
$this->rights->commande->valider = 1;
if ($obj->fk_id == 89)
$this->rights->commande->supprimer = 1;
}
if ($module == 'expedition' or $module == '')
{
if ($obj->fk_id == 101)
$this->rights->expedition->lire = 1;
if ($obj->fk_id == 102)
$this->rights->expedition->creer = 1;
if ($obj->fk_id == 104)
$this->rights->expedition->valider = 1;
if ($obj->fk_id == 109)
$this->rights->expedition->supprimer = 1;
}
if ($module == 'adherent' or $module == '')
{
if ($obj->fk_id == 71)
$this->rights->adherent->lire = 1;
if ($obj->fk_id == 72)
$this->rights->adherent->creer = 1;
if ($obj->fk_id == 73)
$this->rights->adherent->modifier = 1;
if ($obj->fk_id == 74)
$this->rights->adherent->supprimer = 1;
}
if ($module == 'compta' or $module == '')
{
if ($obj->fk_id == 91)
$this->rights->compta->charges->lire = 1;
if ($obj->fk_id == 92)
$this->rights->compta->charges->creer = 1;
if ($obj->fk_id == 93)
$this->rights->compta->charges->supprimer = 1;
if ($obj->fk_id == 95)
$this->rights->compta->resultat->lire = 1;
}
if ($module == 'banque' or $module == '')
{
if ($obj->fk_id == 111)
$this->rights->banque->lire = 1;
if ($obj->fk_id == 112)
$this->rights->banque->modifier = 1;
if ($obj->fk_id == 113)
$this->rights->banque->configurer = 1;
}
if ($module == 'societe' or $module == '')
{
if ($obj->fk_id == 121)
$this->rights->societe->lire = 1;
if ($obj->fk_id == 122)
$this->rights->societe->creer = 1;
if ($obj->fk_id == 129)
$this->rights->societe->supprimer = 1;
}
if ($module == 'caisse' or $module == '')
{
if ($obj->fk_id == 131)
$this->rights->caisse->lire = 1;
if ($obj->fk_id == 132)
$this->rights->caisse->modifier = 1;
if ($obj->fk_id == 133)
$this->rights->caisse->configurer = 1;
}
if ($module == 'telephonie' or $module == '')
{
if ($obj->fk_id == 141)
$this->rights->telephonie->lire = 1;
if ($obj->fk_id == 142)
$this->rights->telephonie->ligne_commander = 1;
if ($obj->fk_id == 143)
$this->rights->telephonie->ligne_activer = 1;
}
if ($module == 'prelevement' or $module == '')
{
if ($obj->fk_id == 151)
$this->rights->prelevement->lire = 1;
if ($obj->fk_id == 152)
$this->rights->prelevement->configurer = 1;
}
if ($module == 'contrat' or $module == '')
{
if ($obj->fk_id == 161)
$this->rights->contrat->lire = 1;
if ($obj->fk_id == 162)
$this->rights->contrat->creer = 1;
if ($obj->fk_id == 163)
$this->rights->contrat->activer = 1;
if ($obj->fk_id == 164)
$this->rights->contrat->desactiver = 1;
}
$i++;
}
$this->db->free();
}
else
{
dolibarr_print_error($this->db);
}
/*
* Nouvelle méthode
* Compatible avec l'ancienne
*
* Récupération des droits
*/
$sql = "SELECT r.module, r.perms, r.subperms ";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as u, ".MAIN_DB_PREFIX."rights_def as r";

View File

@ -29,6 +29,88 @@ alter table llx_paiement add fk_export_compta integer DEFAULT 0 NOT NULL ;
alter table llx_rights_def add perms varchar(255) after module;
alter table llx_rights_def add subperms varchar(255) after perms;
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="10";
UPDATE llx_rights_def set perms="lire", subperms=NULL where id="11";
UPDATE llx_rights_def set perms="creer", subperms=NULL where id="12";
UPDATE llx_rights_def set perms="valider", subperms=NULL where id="14";
UPDATE llx_rights_def set perms="envoyer", subperms=NULL where id="15";
UPDATE llx_rights_def set perms="paiement", subperms=NULL where id="16";
UPDATE llx_rights_def set perms="supprimer", subperms=NULL where id="19";
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="20";
UPDATE llx_rights_def set perms="lire", subperms=NULL where id="21";
UPDATE llx_rights_def set perms="creer", subperms=NULL where id="22";
UPDATE llx_rights_def set perms="valider", subperms=NULL where id="24";
UPDATE llx_rights_def set perms="envoyer", subperms=NULL where id="25";
UPDATE llx_rights_def set perms="cloturer", subperms=NULL where id="26";
UPDATE llx_rights_def set perms="supprimer", subperms=NULL where id="27";
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="30";
UPDATE llx_rights_def set perms="lire", subperms=NULL where id="31";
UPDATE llx_rights_def set perms="creer", subperms=NULL where id="32";
UPDATE llx_rights_def set perms="commander", subperms=NULL where id="33";
UPDATE llx_rights_def set perms="supprimer", subperms=NULL where id="34";
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="40";
UPDATE llx_rights_def set perms="lire", subperms=NULL where id="41";
UPDATE llx_rights_def set perms="creer", subperms=NULL where id="42";
UPDATE llx_rights_def set perms="supprimer", subperms=NULL where id="44";
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="70";
UPDATE llx_rights_def set perms="lire", subperms=NULL where id="71";
UPDATE llx_rights_def set perms="creer", subperms=NULL where id="72";
UPDATE llx_rights_def set perms="modifier", subperms=NULL where id="73";
UPDATE llx_rights_def set perms="supprimer", subperms=NULL where id="74";
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="80";
UPDATE llx_rights_def set perms="lire", subperms=NULL where id="81";
UPDATE llx_rights_def set perms="creer", subperms=NULL where id="82";
UPDATE llx_rights_def set perms="valider", subperms=NULL where id="84";
UPDATE llx_rights_def set perms="supprimer", subperms=NULL where id="89";
UPDATE llx_rights_def set perms=NULL, subperms=NULL where id="90";
UPDATE llx_rights_def set perms="charges", subperms="lire" where id="91";
UPDATE llx_rights_def set perms="charges", subperms="creer" where id="92";
UPDATE llx_rights_def set perms="charges", subperms="supprimer" where id="93";
UPDATE llx_rights_def set perms="resultat", subperms="lire" where id="95";
UPDATE llx_rights_def set perms="ventilation", subperms="parametrer" where id="96";
UPDATE llx_rights_def set perms="ventilation", subperms="creer" where id="97";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="100";
UPDATE llx_rights_def set perms= "lire", subperms=NULL where id="101";
UPDATE llx_rights_def set perms= "creer", subperms=NULL where id="102";
UPDATE llx_rights_def set perms= "valider", subperms=NULL where id="104";
UPDATE llx_rights_def set perms= "supprimer", subperms=NULL where id="109";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="110";
UPDATE llx_rights_def set perms= "lire", subperms=NULL where id="111";
UPDATE llx_rights_def set perms= "modifier", subperms=NULL where id="112";
UPDATE llx_rights_def set perms= "configurer", subperms=NULL where id="113";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="120";
UPDATE llx_rights_def set perms= "lire", subperms=NULL where id="121";
UPDATE llx_rights_def set perms= "creer", subperms=NULL where id="122";
UPDATE llx_rights_def set perms= "supprimer", subperms=NULL where id="129";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="140";
UPDATE llx_rights_def set perms= "lire", subperms=NULL where id="141";
UPDATE llx_rights_def set perms= "ligne_commander", subperms=NULL where id="142";
UPDATE llx_rights_def set perms= "ligne_activer", subperms=NULL where id="143";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="144";
UPDATE llx_rights_def set perms= "fournisseur", subperms="config" where id="145";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="150";
UPDATE llx_rights_def set perms= "lire", subperms=NULL where id="151";
UPDATE llx_rights_def set perms= "configurer", subperms=NULL where id="152";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="160";
UPDATE llx_rights_def set perms= "lire", subperms=NULL where id="161";
UPDATE llx_rights_def set perms= "creer", subperms=NULL where id="162";
UPDATE llx_rights_def set perms= "activer", subperms=NULL where id="163";
UPDATE llx_rights_def set perms= "desactiver", subperms=NULL where id="164";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="170";
UPDATE llx_rights_def set perms= NULL, subperms=NULL where id="180";
UPDATE llx_rights_def set perms= "commande", subperms="lire" where id="181";
UPDATE llx_rights_def set perms= "commande", subperms="creer" where id="182";
UPDATE llx_rights_def set perms= "commande", subperms="valider" where id="183";
UPDATE llx_rights_def set perms= "commande", subperms="approuver" where id="184";
UPDATE llx_rights_def set perms= "commande", subperms="commander" where id="185";
UPDATE llx_rights_def set perms= "commande", subperms="cloturer" where id="186";
UPDATE llx_rights_def set perms= "ligne", subperms="creer" where id="192";
UPDATE llx_rights_def set perms= "adsl", subperms="creer" where id="202";
UPDATE llx_rights_def set perms= "adsl", subperms="requete" where id="203";
UPDATE llx_rights_def set perms= "adsl", subperms="commander" where id="204";
UPDATE llx_rights_def set perms= "adsl", subperms="gerer" where id="205";
UPDATE llx_rights_def set perms= "contrat", subperms="paiement" where id="215";
alter table llx_facturedet add fk_code_ventilation integer NOT NULL DEFAULT 0;