Fix: bad language selection
This commit is contained in:
parent
205666c206
commit
703e35ad73
@ -195,26 +195,26 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/pdf/ModelePdfExpedition.class.php");
|
||||
|
||||
// Sauvegarde le dernier modele choisi pour generer un document
|
||||
$expedition = new Expedition($db, 0, $_REQUEST['id']);
|
||||
$expedition->fetch($_REQUEST['id']);
|
||||
$expedition->fetch_client();
|
||||
$shipment = new Expedition($db, 0, $_REQUEST['id']);
|
||||
$shipment->fetch($_REQUEST['id']);
|
||||
$shipment->fetch_client();
|
||||
|
||||
if ($_REQUEST['model'])
|
||||
{
|
||||
$expedition->setDocModel($user, $_REQUEST['model']);
|
||||
$shipment->setDocModel($user, $_REQUEST['model']);
|
||||
}
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$expedition->client->default_lang;
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=expedition_pdf_create($db,$expedition->id,$expedition->modelpdf,$outputlangs);
|
||||
$result=expedition_pdf_create($db,$_REQUEST['id'],$_REQUEST['model'],$outputlangs);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
|
||||
@ -111,7 +111,7 @@ function expedition_pdf_create($db, $id, $modele, $outputlangs)
|
||||
// We save charset_output to restore it because write_file can change it if needed for
|
||||
// output format that does not support UTF8.
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
if ($obj->write_file($expedition, $langs) > 0)
|
||||
if ($obj->write_file($expedition, $outputlangs) > 0)
|
||||
{
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
// on supprime l'image correspondant au preview
|
||||
|
||||
@ -86,6 +86,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("sendings");
|
||||
$outputlangs->load("deliveries");
|
||||
|
||||
//Generation de la fiche
|
||||
$this->expe = $object;
|
||||
|
||||
@ -236,6 +236,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("deliveries");
|
||||
|
||||
if ($conf->expedition->dir_output."/sending")
|
||||
{
|
||||
|
||||
@ -20,11 +20,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/includes/modules/propale/modules_propale.php
|
||||
\ingroup propale
|
||||
\brief Fichier contenant la classe m<EFBFBD>re de generation des propales en PDF
|
||||
et la classe m<EFBFBD>re de num<EFBFBD>rotation des propales
|
||||
\version $Id$
|
||||
* \file htdocs/includes/modules/propale/modules_propale.php
|
||||
* \ingroup propale
|
||||
* \brief Fichier contenant la classe mere de generation des propales en PDF
|
||||
* et la classe mere de numerotation des propales
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user