diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 857bc2e4653c48d53ea993bae752faf27ba8463e..b7d06d10ff590f9598edcef590ec7f92bc04e124 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -163,15 +163,37 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='') // Description if ($objp->fk_product > 0) { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $object = new $origin($db); + $object->fetch($origin_id); + $object->fetch_thirdparty(); + $prod = new Product($db, $objp->fk_product); + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $objp->product; + } + else + $label = $objp->product; + print '<td>'; // Show product and description $product_static->type=$objp->fk_product_type; $product_static->id=$objp->fk_product; $product_static->ref=$objp->ref; - $product_static->libelle=$objp->product; + $product_static->libelle=$label; $text=$product_static->getNomUrl(1); - $text.= ' - '.$objp->product; + $text.= ' - '.$label; $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)); print $form->textwithtooltip($text,$description,3,'','',$i); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 2b8c849512694120865b716e06b5068bfcd65b2d..fa93422cec4768325f93d8deed9f1d1009255344 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -1145,6 +1145,26 @@ else // Predefined product or service if ($lines[$i]->fk_product > 0) { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $object->fetch_thirdparty(); + $prod = new Product($db, $lines[$i]->fk_product); + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; + } + else + $label = $lines[$i]->product_label; + print '<td>'; // Affiche ligne produit @@ -1152,7 +1172,7 @@ else if ($lines[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service'); else $text.= img_object($langs->trans('ShowProduct'),'product'); $text.= ' '.$lines[$i]->ref.'</a>'; - $text.= ' - '.$lines[$i]->label; + $text.= ' - '.$label; $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($lines[$i]->description)); //print $description; print $form->textwithtooltip($text,$description,3,'','',$i); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index f92de82038fa0c5afd2bbc3a767f6205b4b462e4..e114a6a908238b0c2c047c8ede530ac150bd0789 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -440,6 +440,26 @@ if ($id > 0 || ! empty($ref)) // Product label if ($objp->fk_product > 0) { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $commande->fetch_thirdparty(); + $prod = new Product($db, $objp->fk_product); + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $objp->product_label; + } + else + $label = $objp->product_label; + print '<td>'; print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne @@ -447,9 +467,9 @@ if ($id > 0 || ! empty($ref)) $product_static->type=$objp->fk_product_type; $product_static->id=$objp->fk_product; $product_static->ref=$objp->ref; - $product_static->libelle=$objp->product_label; + $product_static->libelle=$label; $text=$product_static->getNomUrl(1); - $text.= ' - '.$objp->product_label; + $text.= ' - '.$label; $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)); print $form->textwithtooltip($text,$description,3,'','',$i); diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 5e03bbec77d7f159b3705631a06720519b74f9da..797cfac9125177cdf95f2ffcc5ba8ed1745c187e 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -308,8 +308,27 @@ if ($_GET["action"] == 'create') $product->fetch($line->fk_product); $product->load_stock(); + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $commande->fetch_thirdparty(); + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($product->multilangs[$outputlangs->defaultlang]["libelle"])) ? $product->multilangs[$outputlangs->defaultlang]["libelle"] : $product->libelle; + } + else + $label = $product->libelle; + print '<td>'; - print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.$product->libelle; + print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.$label; if ($line->description) print nl2br($line->description); print '</td>'; } @@ -530,6 +549,25 @@ else $product = new Product($db); $product->fetch($delivery->lines[$i]->fk_product); + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $delivery->fetch_thirdparty(); + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (empty($newlang)) $newlang=$delivery->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($product->multilangs[$outputlangs->defaultlang]["libelle"])) ? $product->multilangs[$outputlangs->defaultlang]["libelle"] : $delivery->lines[$i]->product_label; + } + else + $label = $delivery->lines[$i]->product_label; + print '<td>'; // Affiche ligne produit @@ -537,7 +575,7 @@ else if ($delivery->lines[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service'); else $text.= img_object($langs->trans('ShowProduct'),'product'); $text.= ' '.$delivery->lines[$i]->ref.'</a>'; - $text.= ' - '.$delivery->lines[$i]->label; + $text.= ' - '.$label; $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($delivery->lines[$i]->description)); //print $description; print $form->textwithtooltip($text,$description,3,'','',$i);