diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index 130bf90f9ec..e47b464a47a 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -36,7 +36,7 @@ class Categorie var $label; var $description; var $statut; - var $type; + var $type; // 0=Produit, 1=Fournisseur, 2=Tiers var $cats=array(); // Tableau en memoire des categories var $motherof = array(); // Tableau des correspondances id_fille -> id_mere @@ -481,7 +481,7 @@ class Categorie $res = $this->db->query ($sql); if ($res) { - $cats = array (); + $this->cats = array(); $i=0; while ($obj = $this->db->fetch_object($res)) { diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index dd06892e296..13584786973 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2005 Brice Davoleau * Copyright (C) 2005-2006 Regis Houssin - * Copyright (C) 2006 Laurent Destailleur + * Copyright (C) 2006-2007 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 3154cd8cd5c..599b0f6b1c5 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -44,7 +44,8 @@ $c = new Categorie($db); $html = new Form($db); if (! $type) $title=$langs->trans("ProductsCategoriesArea"); -if ($type == 1) $title=$langs->trans("ThirdPartyCategoriesArea"); +if ($type == 1) $title=$langs->trans("SuppliersCategoriesArea"); +if ($type == 2) $title=$langs->trans("ThirdPartyCategoriesArea"); llxHeader("","",$title); diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 4bc03fb7c6c..db4f36121ad 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1546,9 +1546,11 @@ class Form } /** - * \brief Retourne la ou les listes déroulante des catégories en fonction - * du nombre choisi - * \param selected nombre de catégorie à créer + * \brief Retourne la liste des catégories en fonction + * du nombre choisi. + * \param type Type de categories + * \param selected Id categorie preselectionnee + * \param select_name Nom formulaire HTML */ function select_all_categories($type,$selected='',$select_name="") { @@ -1557,28 +1559,30 @@ class Form if ($select_name=="") $select_name="catMere"; - $cat = new Categorie ($this -> db); + $cat = new Categorie($this->db); $cate_arbo = $cat->get_full_arbo($type); $output = ''; $output.= "\n"; return $output; diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 3a960cda4ec..4220437c66c 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -231,6 +231,17 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/contact/fiche.php?leftmenu=contacts&action=create", $langs->trans("NewContact"), 1, $user->rights->societe->creer); $newmenu->add_submenu(DOL_URL_ROOT."/contact/index.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->lire); + if ($conf->categorie->enabled) + { + $langs->load("categories"); + $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=2", $langs->trans("Categories"), 0, $user->rights->categorie->lire); + if ($user->societe_id == 0) + { + $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=2", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); + } + //if ($leftmenu=="cat") $newmenu->add_submenu(DOL_URL_ROOT."/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + } + } /* @@ -596,7 +607,7 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 0, $user->rights->categorie->lire); if ($user->societe_id == 0) { - if ($leftmenu=="cat") $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=0", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=0", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); } //if ($leftmenu=="cat") $newmenu->add_submenu(DOL_URL_ROOT."/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire); } @@ -646,6 +657,17 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/fourn/commande/liste.php?leftmenu=suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); } + if ($conf->categorie->enabled) + { + $langs->load("categories"); + $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=1", $langs->trans("Categories"), 0, $user->rights->categorie->lire); + if ($user->societe_id == 0) + { + $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=1", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); + } + //if ($leftmenu=="cat") $newmenu->add_submenu(DOL_URL_ROOT."/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + } + } diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index fa8abb0fc62..560ddeb027f 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -10,6 +10,8 @@ Classify=Classify CategoriesArea=Categories area ProductsCategoriesArea=Products/Services' categories area SuppliersCategoriesArea=Suppliers' categories area +CustomersCategoriesArea=Customers' categories area +ThirdPartyCategoriesArea=Third parties' categories area MainCats=Main categories SubCats=Subcategories CatStatistics=Statistics diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 71810a1f0a8..241742b34f9 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -8,8 +8,10 @@ AddIn=Ajouter dans modify=modifier Classify=Classer CategoriesArea=Espace catégories -ProductsCategoriesArea=Espace catégories de produits et services -SuppliersCategoriesArea=Espace catégories de fournisseurs +ProductsCategoriesArea=Espace des catégories de produits et services +SuppliersCategoriesArea=Espace des catégories fournisseurs +CustomersCategoriesArea=Espace des catégories clients +ThirdPartyCategoriesArea=Espace des catégories de tiers MainCats=Catégories principales SubCats=Sous-catégories CatStatistics=Statistiques