From ee843924dd56d1d5b47346a99125bb3f2e8f91c4 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Mon, 22 Apr 2013 10:33:06 +0200
Subject: [PATCH] Fix: Some translation change to have things more clear.

---
 htdocs/core/class/html.form.class.php  |  4 ++--
 htdocs/langs/en_US/products.lang       | 12 +++++++-----
 htdocs/langs/fr_FR/products.lang       | 16 +++++++++-------
 htdocs/product/class/product.class.php |  7 ++++---
 htdocs/product/composition/fiche.php   | 15 ++++++++++-----
 5 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 944f364ee4b..97658572831 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -344,7 +344,7 @@ class Form
      *	Show a text and picto with tooltip on text or picto
      *
      *	@param	string		$text				Text to show
-     *	@param	string		$htmltext			Content html of tooltip. Must be HTML/UTF8 encoded.
+     *	@param	string		$htmltext			HTML content of tooltip. Must be HTML/UTF8 encoded.
      *	@param	int			$tooltipon			1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
      *	@param	int			$direction			-1=Le picto est avant, 0=pas de picto, 1=le picto est apres
      *	@param	string		$img				Code img du picto (use img_xxx() function to get it)
@@ -383,7 +383,7 @@ class Form
         //if ($text != '')	$s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
         $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':'');
         $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':'');
-        if ($text != '')	$s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
+        if ((string) $text != '')	$s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
         if ($direction > 0)	$s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
         if (empty($notabs))	$s.='</tr></table>';
 
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index b58dec53dcb..6ba653600e4 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -111,10 +111,12 @@ ServiceLimitedDuration=If product is a service with limited duration:
 MultiPricesAbility=Activate the multi-prices
 MultiPricesNumPrices=Number of price
 MultiPriceLevelsName=Price categories
-AssociatedProductsAbility=Activate the sub-products 
-AssociatedProducts=Sub-products
-AssociatedProductsNumber=Number of products composing this product
-ParentProductsNumber=Number of parent product
+AssociatedProductsAbility=Activate the virtual products feature 
+AssociatedProducts=Virtual product
+AssociatedProductsNumber=Number of products composing this virtual product
+ParentProductsNumber=Number of parent virtual product
+IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product
+IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product
 EditAssociate=Associate
 Translation=Translation
 KeywordFilter=Keyword filter
@@ -124,7 +126,7 @@ AddDel=Add/Delete
 Quantity=Quantity
 NoMatchFound=No match found
 ProductAssociationList=List of related products/services: name of product/service (quantity affected)
-ProductParentList=List of products/services with this product as a component
+ProductParentList=List of virtual products/services with this product as a component
 ErrorAssociationIsFatherOfThis=One of selected product is parent with current product
 DeleteProduct=Delete a product/service
 ConfirmDeleteProduct=Are you sure you want to delete this product/service?
diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang
index 3d27fdd9d6d..f5ce6482353 100644
--- a/htdocs/langs/fr_FR/products.lang
+++ b/htdocs/langs/fr_FR/products.lang
@@ -111,11 +111,13 @@ ServiceLimitedDuration=Si produit de type service à durée limitée :
 MultiPricesAbility=Prise en charge de prix multiples
 MultiPricesNumPrices=Nombre de prix
 MultiPriceLevelsName=Catégorie de prix
-AssociatedProductsAbility=Prise en charge des produits composés
-AssociatedProducts=Composition
-AssociatedProductsNumber=Nbre de sous-produits composant ce produit
-ParentProductsNumber=Nbre de produits parent
-EditAssociate=Composer
+AssociatedProductsAbility=Prise en charge des produits virtuels
+AssociatedProducts=Produit virtuel
+AssociatedProductsNumber=Nbre de sous-produits constituant ce produit virtuel
+ParentProductsNumber=Nbre de produits virtuels parent
+IfZeroItIsNotAVirtualProduct=Si 0, ce produit n'est pas un produit virtuel
+IfZeroItIsNotUsedByVirtualProduct=Si 0, ce produit n'est pas utilisé par un produit virtuel
+EditAssociate=Composer comme produit virtuel
 Translation=Traduction 
 KeywordFilter=Filtre par mot-clé
 CategoryFilter=Filtre par catégorie
@@ -123,8 +125,8 @@ ProductToAddSearch=Recherche des produits à ajouter
 AddDel=Ajouter/Retirer
 Quantity=Quantité
 NoMatchFound=Aucun résultat n'a été trouvé 
-ProductAssociationList=Liste des produits/services composant ce produit: Le nombre entre parenthèse est la quantité affectée dans cette composition.
-ProductParentList=Liste des produits/services avec ce produit comme composante
+ProductAssociationList=Liste des produits/services composant ce produit virtuel: Le nombre entre parenthèse est la quantité affectée dans cette composition.
+ProductParentList=Liste des produits/services virtuels avec ce produit comme composante
 ErrorAssociationIsFatherOfThis=L'un des produits sélectionnés est parent du produit en cours
 DeleteProduct=Supprimer un produit/service
 ConfirmDeleteProduct=Êtes-vous sûr de vouloir supprimer ce produit/service ?
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index a8803d6e5e8..f6219d5acd4 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -2137,6 +2137,7 @@ class Product extends CommonObject
 				$id=(! empty($desc_pere[0]) ? $desc_pere[0] :'');
 				$nb=(! empty($desc_pere[1]) ? $desc_pere[1] :'');
 				$type=(! empty($desc_pere[2]) ? $desc_pere[2] :'');
+				$label=(! empty($desc_pere[3]) ? $desc_pere[3] :'');
 
 				if ($multiply)
 				{
@@ -2157,10 +2158,10 @@ class Product extends CommonObject
 */								'id'=>$id,					// Id product
 								'nb'=>$nb,					// Nb of units that compose parent product
 								'nb_total'=>$nb*$multiply,	// Nb of units for all nb of product
-								'stock'=>$this->stock_warehouse[1]->real,		// Stock
+								'stock'=>$this->stock_warehouse[1]->real,	// Stock
 								'stock_alert'=>$this->seuil_stock_alerte,	// Stock alert
-								'fullpath' => $compl_path.$nom_pere,	// Label
-								'type'=>$type					// Nb of units that compose parent product
+								'fullpath' => $compl_path.$label,			// Label
+								'type'=>$type				// Nb of units that compose parent product
 								);
 				}
 				else
diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php
index 804759afe3a..471631cc464 100644
--- a/htdocs/product/composition/fiche.php
+++ b/htdocs/product/composition/fiche.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2011 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2013 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005      Eric Seigne          <eric.seigne@ryxeo.com>
  * Copyright (C) 2005-2012 Regis Houssin        <regis.houssin@capnetworks.com>
  * Copyright (C) 2006      Andre Cianfarani     <acianfa@free.fr>
@@ -200,12 +200,15 @@ if ($id || $ref)
 			// Number of subproducts
 			$prodsfather = $product->getFather(); //Parent Products
 			$product->get_sousproduits_arbo();
-			print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
+			$nbofsubproducts=count($product->get_arbo_each_prod());
+			print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>';
+			print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct'));
+			print '</td>';
 
 			dol_fiche_end();
 
 
-			// List of subproducts
+			// List of products into this virtual product
 			$prods_arbo = $product->get_arbo_each_prod();
 			if (count($prods_arbo) > 0)
 			{
@@ -231,8 +234,10 @@ if ($id || $ref)
 				print '</td></tr>';
 			}
 
-			// Number of parent products
-			print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>'.count($prodsfather).'</td>';
+			// Number of parent virtual products
+			print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>';
+			print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct'));
+			print '</td>';
 
 			if (count($prodsfather) > 0)
 			{
-- 
GitLab