diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index fd54dd833d7..fa68e73a967 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -47,7 +47,7 @@ class Categorie var $description; var $socid; var $statut; - var $type; // 0=Produit, 1=Fournisseur, 2=Tiers + var $type; // 0=Produit, 1=Tiers fournisseur, 2=Tiers client/prospect var $cats=array(); // Tableau en memoire des categories var $motherof = array(); // Tableau des correspondances id_fille -> id_mere diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index ab5c64eff7d..377c12762f6 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -45,6 +45,7 @@ $entitytoicon=array( 'account'=>'account', 'payment'=>'payment', 'product'=>'product','stock'=>'generic','warehouse'=>'stock', + 'category'=>'generic', 'other'=>'generic', ); $entitytolang=array( // Translation code @@ -58,6 +59,7 @@ $entitytolang=array( // Translation code 'account'=>'BankTransactions', 'payment'=>'Payment', 'product'=>'Product','stock'=>'Stock','warehouse'=>'Warehouse', + 'category'=>'Category', 'other'=>'Other' ); diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index fa8accd2b7c..06ddedf3392 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -52,7 +52,7 @@ print '
'; print ''; -print '
'; +print '
'; // Liste des formats d'exports disponibles @@ -81,7 +81,7 @@ foreach($liste as $key) print '
'; -print ''; +print ''; // Affiche les modules d'exports diff --git a/htdocs/includes/modules/modCategorie.class.php b/htdocs/includes/modules/modCategorie.class.php index 19013bf20b6..2fe3e5c515b 100644 --- a/htdocs/includes/modules/modCategorie.class.php +++ b/htdocs/includes/modules/modCategorie.class.php @@ -57,14 +57,18 @@ class modCategorie extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; - $this->picto = ''; + $this->picto = 'generic'; // Dir $this->dirs = array(); - // Dépendances + // Dependencies $this->depends = array("modProduit"); + // Config pages + $this->config_page_url = array(); + $this->langfiles = array("products","companies","categories"); + // Constantes $this->const = array(); @@ -104,6 +108,46 @@ class modCategorie extends DolibarrModules $this->rights[$r][3] = 1; // La permission est-elle une permission par défaut $this->rights[$r][4] = 'voir'; $r++; + + // Exports + //-------- + $r=0; + + $r++; + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='List of supplier categories'; + $this->export_permission[$r]=array(array("categorie","lire")); + $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'CompanyId','s.nom'=>'Name'); + $this->export_entities_array[$r]=array('u.rowid'=>"category",'u.label'=>"category",'u.description'=>"category",'s.rowid'=>'company','s.nom'=>'company'); + $this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'s.rowid'=>'idsoc','s.nom'=>'name'); + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; + $this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories + + $r++; + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='List of customer/prospect categories'; + $this->export_permission[$r]=array(array("categorie","lire")); + $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'CompanyId','s.nom'=>'Name'); + $this->export_entities_array[$r]=array('u.rowid'=>"category",'u.label'=>"category",'u.description'=>"category",'s.rowid'=>'company','s.nom'=>'company'); + $this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'s.rowid'=>'idsoc','s.nom'=>'name'); + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; + $this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories + + $r++; + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='List of products categories'; + $this->export_permission[$r]=array(array("categorie","lire")); + $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'ProductId','p.ref'=>'Ref'); + $this->export_entities_array[$r]=array('u.rowid'=>"category",'u.label'=>"category",'u.description'=>"category",'p.rowid'=>'product','p.ref'=>'product'); + $this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'p.rowid'=>'idprod','p.ref'=>'ref'); + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p'; + $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_product = p.rowid'; + $this->export_sql_end[$r] .=' AND u.type = 0'; // Supplier categories } diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index 4afbe9a7f7e..8d77dad1fdd 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -68,7 +68,7 @@ class modProduit extends DolibarrModules // Dir $this->dirs = array(); - // D�pendances + // Dependencies $this->depends = array(); $this->requiredby = array("modStock","modService","modBarcode"); diff --git a/htdocs/includes/modules/modUser.class.php b/htdocs/includes/modules/modUser.class.php index ac4f2091b5b..3bc33155029 100644 --- a/htdocs/includes/modules/modUser.class.php +++ b/htdocs/includes/modules/modUser.class.php @@ -15,28 +15,25 @@ * 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. - * - * $Id$ */ /** - \defgroup user Module user - \brief Module pour g�rer les utilisateurs + * \defgroup user Module user + * \brief Module pour gerer les utilisateurs */ /** - \file htdocs/includes/modules/modUser.class.php - \ingroup user - \brief Fichier de description et activation du module Utilisateur + * \file htdocs/includes/modules/modUser.class.php + * \ingroup user + * \brief Fichier de description et activation du module Utilisateur */ include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); /** - \class modUser - \brief Classe de description et activation du module User + * \class modUser + * \brief Classe de description et activation du module User */ - class modUser extends DolibarrModules { diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 82f187ce620..75e13450eae 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -75,4 +75,5 @@ ThisCategoryHasNoCustomer=This category does not contain any customer. AssignedToCustomer=Assigned to a customer AssignedToTheCustomer=Assigned to the customer InternalCategory=Inernal category -CategoryContents=Category contents \ No newline at end of file +CategoryContents=Category contents +CategId=Category id \ No newline at end of file diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 4c864dd872d..718031819d7 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -75,4 +75,5 @@ ThisCategoryHasNoCustomer=Cette cat AssignedToCustomer=Attribuer à un client AssignedToTheCustomer=Attribué au client InternalCategory=Catégorie interne -CategoryContents=Contenu de la catégorie \ No newline at end of file +CategoryContents=Contenu de la catégorie +CategId=Id categorie \ No newline at end of file