Much better fix for translated product description into PDF

This commit is contained in:
Florian Henry 2013-12-03 17:06:19 +01:00
parent bc4cfd66db
commit c2a8967b52

View File

@ -926,22 +926,14 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
//Manage HTML entities description test //Manage HTML entities description test
//Cause $prodser->description is store with htmlentities but $desc no //Cause $prodser->description is store with htmlentities but $desc no
$testHTMLDescNeedTranslated=true; $needdesctranslation=false;
$testDescNeedTranslated=true; if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
if ($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) { $needdesctranslation=(strpos(dol_html_entity_decode($desc,ENT_QUOTES | ENT_HTML401),dol_html_entity_decode($prodser->description,ENT_QUOTES | ENT_HTML401))!==false);
if (!empty($desc) && !empty($prodser->description)) {
$testHTMLDescNeedTranslated=(strpos(dol_html_entity_decode($desc,ENT_QUOTES | ENT_HTML401),dol_html_entity_decode($prodser->description,ENT_QUOTES | ENT_HTML401))!==false);
}
$testDescNeedTranslated=false;
} else { } else {
if (!empty($desc) && !empty($prodser->description)) { $needdesctranslation=($desc == $prodser->description);
$testDescNeedTranslated = (strpos($desc,$prodser->description)!==false);
} else {
$testDescNeedTranslated=false;
}
} }
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($testHTMLDescNeedTranslated || $testDescNeedTranslated)) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"]; if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($needdesctranslation)) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"];
} }
} }