From 1099290a42e3e03f4d19f855e860077c31353b74 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 13 Apr 2005 09:51:00 +0000 Subject: [PATCH] Nouveau fichier --- .../includes/modules/modCategorie.class.php | 119 ++++++++++++++++++ htdocs/langs/fr_FR/categories.lang | 29 +++++ 2 files changed, 148 insertions(+) create mode 100644 htdocs/includes/modules/modCategorie.class.php create mode 100644 htdocs/langs/fr_FR/categories.lang diff --git a/htdocs/includes/modules/modCategorie.class.php b/htdocs/includes/modules/modCategorie.class.php new file mode 100644 index 00000000000..463b955fdc8 --- /dev/null +++ b/htdocs/includes/modules/modCategorie.class.php @@ -0,0 +1,119 @@ + + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/** \defgroup produit Module produit + \brief Module pour gérer le suivi de produits prédéfinis +*/ + +/** + \file htdocs/includes/modules/modProduit.class.php + \ingroup produit + \brief Fichier de description et activation du module Produit +*/ + +include_once "DolibarrModules.class.php"; + +/** \class modProduit + \brief Classe de description et activation du module Produit +*/ + +class modCategorie extends DolibarrModules +{ + + /** + * \brief Constructeur. définit les noms, constantes et boîtes + * \param DB handler d'accès base + */ + function modCategorie ($DB) + { + $this->db = $DB; + $this->numero = 1780; + + $this->family = "products"; + $this->name = "Catégorie"; + $this->description = "Gestion des catégories"; + $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version + $this->const_name = "MAIN_MODULE_CATEGORIE"; + $this->const_config = MAIN_MODULE_CATEGORIE; + $this->special = 0; + $this->picto = 'categorie'; + + // Dir + $this->dirs = array(); + + // Dépendances + $this->depends = array("modProduit"); + + // Constantes + $this->const = array(); + + // Boxes + $this->boxes = array(); + $this->boxes[0][0] = "Dernières catégories enregistrées"; + $this->boxes[0][1] = "box_last_cats.php"; + + // Permissions + $this->rights = array(); + $this->rights_class = 'categorie'; + } + + /** + * \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module. + * Définit également les répertoires de données à créer pour ce module. + */ + function init() + { + // Permissions + $this->remove(); + + $this->rights[0][0] = 241; // id de la permission + $this->rights[0][1] = 'Lire les catégories'; // libelle de la permission + $this->rights[0][2] = 'r'; // type de la permission (déprécié à ce jour) + $this->rights[0][3] = 1; // La permission est-elle une permission par défaut + $this->rights[0][4] = 'lire'; + + $this->rights[1][0] = 242; // id de la permission + $this->rights[1][1] = 'Créer/modifier les catégories'; // libelle de la permission + $this->rights[1][2] = 'w'; // 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] = 'creer'; + + $this->rights[2][0] = 243; // id de la permission + $this->rights[2][1] = 'Supprimer les catégories'; // libelle de la permission + $this->rights[2][2] = 'd'; // 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] = 'supprimer'; + + $sql = array(); + + return $this->_init($sql); + } + + /** + * \brief Fonction appelée lors de la désactivation d'un module. + * Supprime de la base les constantes, boites et permissions du module. + */ + function remove() + { + $sql = array(); + + return $this->_remove($sql); + } +} +?> diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang new file mode 100644 index 00000000000..a69ee2635b0 --- /dev/null +++ b/htdocs/langs/fr_FR/categories.lang @@ -0,0 +1,29 @@ +# Dolibarr language file - fr_FR - categories +Categorie=Catégorie +categories=catégorie(s) +In=Dans +modify=modifier +CategoriesArea=Espace catégories +MainCats=Catégories principales +SubCats=Sous-catégories +CatStatistics=Statistiques +CatList=Liste des catégories +AllCats=Toutes les catégories +ViewCat=Visualisation de la catégorie +NewCat=Nouvelle catégorie +ModifCat=Modifier une catégorie +CatCreated=Catégorie ajoutée +CreateCat=Ajouter une catégorie +CreateThisCat=Ajouter cette catégorie +ValidateFields=Valider les champs +NoSubCat=Cette catégorie ne contient aucune sous-catégorie. +SubCatOf=Sous-catégorie +NoProd=Cette catégorie ne contient aucun produit. +FoundCats=Catégories trouvées +FoundCatsForName=Catégories trouvées pour le nom : +FoundSubCatsIn=Sous-catégories trouvées dans la catégorie +ErrSameCatSelected=Vous avez sélectionné la même catégorie plusieurs fois +ErrForgotCat=Vous avez oublié de choisir la catégorie +ErrForgotField=Vous avez oublié de renseigner le champs +ErrCatAlreadyExists=Ce nom est déjà utilisé +AddProductToCat=Ajouter ce produit à une catégorie ?