FIX: Dolibarr#16476 version 2a
This commit is contained in:
parent
3517cdf1b4
commit
95766c4787
@ -1382,7 +1382,6 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
|||||||
// @todo : propose model selection
|
// @todo : propose model selection
|
||||||
if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
|
if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$objecttmp = new $objectclass($db);
|
$objecttmp = new $objectclass($db);
|
||||||
$nbok = 0;
|
$nbok = 0;
|
||||||
foreach ($toselect as $toselectid) {
|
foreach ($toselect as $toselectid) {
|
||||||
@ -1390,7 +1389,6 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
|
|||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang = '';
|
$newlang = '';
|
||||||
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||||
$newlang = GETPOST('lang_id', 'aZ09');
|
$newlang = GETPOST('lang_id', 'aZ09');
|
||||||
}
|
}
|
||||||
@ -1401,9 +1399,9 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
|
|||||||
$newlang = $objecttmp->default_lang; // for thirdparty
|
$newlang = $objecttmp->default_lang; // for thirdparty
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty
|
||||||
$objecttmp->fetch_thirdparty();
|
$objecttmp->fetch_thirdparty();
|
||||||
$newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
|
$newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
|
||||||
}
|
}
|
||||||
if (!empty($newlang)) {
|
if (!empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user