Fix missing MAIN_DISABLE_PDF_AUTOUPDATE
This commit is contained in:
parent
ba03b17354
commit
aefdc09cdc
@ -188,19 +188,23 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error,$object->errors,'errors');
|
setEventMessages($object->error,$object->errors,'errors');
|
||||||
}else{
|
}else{
|
||||||
$outputlangs = $langs;
|
// Define output language
|
||||||
$newlang = '';
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
|
{
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
$outputlangs = $langs;
|
||||||
if (! empty($newlang)) {
|
$newlang = '';
|
||||||
$outputlangs = new Translate("", $conf);
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
|
||||||
$outputlangs->setDefaultLang($newlang);
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||||
}
|
if (! empty($newlang)) {
|
||||||
$model=$object->modelpdf;
|
$outputlangs = new Translate("", $conf);
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$model=$object->modelpdf;
|
||||||
if ($result < 0) dol_print_error($db,$result);
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
|
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
if ($result < 0) dol_print_error($db,$result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user