Fix: L'initialisation du tableau de droits doit etre dans le constructeur de manière a etre défini dans toutes les methodes

This commit is contained in:
Laurent Destailleur 2005-08-25 19:58:01 +00:00
parent a0c1ec1d02
commit 5cc501540f

View File

@ -46,78 +46,78 @@ class modCommercial extends DolibarrModules
* \brief Constructeur. Definit les noms, constantes et boites * \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'accès base * \param DB handler d'accès base
*/ */
function modCommercial($DB) function modCommercial($DB)
{ {
$this->db = $DB ; $this->db = $DB ;
$this->numero = 2 ; $this->numero = 2 ;
$this->family = "crm"; $this->family = "crm";
$this->name = "Commercial"; $this->name = "Commercial";
$this->description = "Gestion commercial"; $this->description = "Gestion commercial";
$this->revision = explode(" ","$Revision$"); $this->revision = explode(" ","$Revision$");
$this->version = $this->revision[1]; $this->version = $this->revision[1];
$this->const_name = "MAIN_MODULE_COMMERCIAL"; $this->const_name = "MAIN_MODULE_COMMERCIAL";
$this->const_config = MAIN_MODULE_COMMERCIAL; $this->const_config = MAIN_MODULE_COMMERCIAL;
$this->special = 0; $this->special = 0;
$this->picto='commercial'; $this->picto='commercial';
// Dir // Dir
$this->dirs = array(); $this->dirs = array();
// Dépendances // Dépendances
$this->depends = array("modSociete"); $this->depends = array("modSociete");
$this->requiredby = array("modPropale","modContrat","modCommande",); $this->requiredby = array("modPropale","modContrat","modCommande",);
// Constantes // Constantes
$this->const = array(); $this->const = array();
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
$this->boxes[0][0] = "Derniers clients"; $this->boxes[0][0] = "Derniers clients";
$this->boxes[0][1] = "box_clients.php"; $this->boxes[0][1] = "box_clients.php";
$this->boxes[1][0] = "Derniers prospects enregistrés"; $this->boxes[1][0] = "Derniers prospects enregistrés";
$this->boxes[1][1] = "box_prospect.php"; $this->boxes[1][1] = "box_prospect.php";
// Permissions // Permissions
$this->rights = array(); $this->rights = array();
$this->rights_class = 'commercial'; $this->rights_class = 'commercial';
} $r = 1;
/** // 261 : Permission générale
* \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module. $this->rights[$r][0] = 261;
* Définit également les répertoires de données à créer pour ce module. $this->rights[$r][1] = 'Informations commerciales';
*/ $this->rights[$r][2] = 'r';
function init() $this->rights[$r][3] = 1;
{ $this->rights[$r][4] = 'main';
$sql = array(); $this->rights[$r][5] = 'lire';
$r++;
}
// Permissions /**
$this->remove(); * \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.
$r = 1; * Définit également les répertoires de données à créer pour ce module.
*/
function init()
{
// Permissions
$this->remove();
// 261 : Permission générale $sql = array();
$this->rights[$r][0] = 261;
$this->rights[$r][1] = 'Informations commerciales';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'main';
$this->rights[$r][5] = 'lire';
$r++;
return $this->_init($sql); return $this->_init($sql);
} }
/** /**
* \brief Fonction appelée lors de la désactivation d'un module. * \brief Fonction appelée lors de la désactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module. * Supprime de la base les constantes, boites et permissions du module.
*/ */
function remove() function remove()
{ {
$sql = array(); $sql = array();
return $this->_remove($sql); return $this->_remove($sql);
} }
} }
?> ?>