From 0572f6ffb122cf29567a585a2f351f5647154627 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Mar 2008 00:32:18 +0000 Subject: [PATCH] Fix: Pb and translation of categories --- htdocs/categories/categorie.class.php | 5 ++--- htdocs/categories/categorie.php | 7 ++++--- htdocs/langs/en_US/categories.lang | 3 ++- htdocs/langs/fr_FR/categories.lang | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index 070ab826a25..52063b9c4e6 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2005 Davoleau Brice * Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2006-2007 Regis Houssin - * Copyright (C) 2006-2007 Laurent Destailleur + * Copyright (C) 2006-2008 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * * This program is free software; you can redistribute it and/or modify @@ -19,14 +19,13 @@ * 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$ */ /** \file htdocs/categories/categorie.class.php \ingroup categorie \brief Fichier de la classe des categorie + \version $Id$ */ require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 2764f8371f3..22401fea925 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -39,7 +39,6 @@ if ($_REQUEST["socid"]) if ($_REQUEST["typeid"] == 1) { $type = 'fournisseur'; $socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; } if ($_REQUEST["typeid"] == 2) { $type = 'societe'; $socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; } $objectid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; - $type = 'societe'; } else if ($_REQUEST["id"] || $_REQUEST["ref"]) { @@ -91,11 +90,13 @@ if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0) $type = 'product'; } - $cat = new Categorie($db,$_REQUEST["catMere"]); + $cat = new Categorie($db); + $result=$cat->fetch($_REQUEST["catMere"]); + $result=$cat->add_type($object,$type); if ($result >= 0) { - $mesg='
'.$langs->trans("WasAddedSuccessfully").'
'; + $mesg='
'.$langs->trans("WasAddedSuccessfully",$cat->label).'
'; } else { diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index e1022240ff3..20ab87df680 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -37,7 +37,8 @@ ErrCatAlreadyExists=This name is already used AddProductToCat=Add this product to a category? ImpossibleAddCat=Impossible to add the category ImpossibleAssociateCategory=Impossible to associate the category to -WasAddedSuccessfully=was added successfully. +WasAddedSuccessfully=%s was added successfully. +ObjectAlreadyLinkedToCategory=Element is already linked to this category. CategorySuccessfullyCreated=This category %s has been added with success. ProductIsInCategories=Product/service owns to following categories SupplierIsInCategories=Third party owns to following suppliers categories diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 69580eba22b..0bac2f1d76a 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -37,7 +37,8 @@ ErrCatAlreadyExists=Ce nom est d AddProductToCat=Ajouter ce produit à une catégorie ? ImpossibleAddCat=Impossible d'ajouter la catégorie ImpossibleAssociateCategory=Impossible d'associer la catégorie -WasAddedSuccessfully=a été ajoutée avec succès. +WasAddedSuccessfully=%s a été ajoutée avec succès. +ObjectAlreadyLinkedToCategory=L'élément est déjà lié à cette catégorie. CategorySuccessfullyCreated=La catégorie %s a été ajouté avec succès. ProductIsInCategories=Ce produit/service est dans les catégories suivantes SupplierIsInCategories=Ce fournisseur est dans les catégories suivantes