Merge pull request #3564 from FHenry/3.8

FIX : remove twice same test
This commit is contained in:
Laurent Destailleur 2015-09-23 00:07:28 +02:00
commit 00b858e644

View File

@ -195,22 +195,18 @@ if (empty($reshook))
{ {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language $outputlangs = $langs;
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $newlang = '';
{ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
$outputlangs = $langs; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
$newlang = ''; if (! empty($newlang)) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); $outputlangs = new Translate("", $conf);
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; $outputlangs->setDefaultLang($newlang);
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} else { } else {
$langs->load("errors"); $langs->load("errors");