Skip to content
Snippets Groups Projects
Commit 6a90298a authored by Christophe Battarel's avatar Christophe Battarel
Browse files

affiche libellé produit dans la langue du client en plus de la description...

affiche libellé produit dans la langue du client en plus de la description (variable de conf renommée en PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE
parent 5524d42d
No related branches found
No related tags found
No related merge requests found
......@@ -747,7 +747,7 @@ else if ($action == "addline" && $user->rights->propale->creer)
}
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE))
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
......
......@@ -554,7 +554,7 @@ if ($action == 'addline' && $user->rights->commande->creer)
}
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE))
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
......
......@@ -998,7 +998,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
}
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE))
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
......
......@@ -2,6 +2,7 @@
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -2096,12 +2097,34 @@ abstract class CommonObject
{
$product_static = new Product($this->db);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$this->fetch_thirdparty();
$prod = new Product($this->db, $line->fk_product);
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$this->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"] : $line->product_label;
}
else {
$label = $line->product_label;
}
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
$product_static->libelle=$line->product_label;
$product_static->libelle=$label;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$line->product_label;
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description));
// Use global variables + $seller and $buyer
......
......@@ -70,10 +70,10 @@ else if ($action == 'viewProdDescInForm')
$view = GETPOST("activate_viewProdDescInForm");
$res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $view,'chaine',0,'',$conf->entity);
}
else if ($action == 'viewProdDescInThirdpartyLanguage')
else if ($action == 'viewProdTextsInThirdpartyLanguage')
{
$view = GETPOST("activate_viewProdDescInThirdpartyLanguage");
$res = dolibarr_set_const($db, "PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE", $view,'chaine',0,'',$conf->entity);
$view = GETPOST("activate_viewProdTextsInThirdpartyLanguage");
$res = dolibarr_set_const($db, "PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE", $view,'chaine',0,'',$conf->entity);
}
else if ($action == 'usesearchtoselectproduct')
{
......@@ -261,11 +261,11 @@ if (! empty($conf->global->MAIN_MULTILANGS))
$var=!$var;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="viewProdDescInThirdpartyLanguage">';
print '<input type="hidden" name="action" value="viewProdTextsInThirdpartyLanguage">';
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
print '<td width="60" align="right">';
print $form->selectyesno("activate_viewProdDescInThirdpartyLanguage",$conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE,1);
print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage",$conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE,1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</td>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment