Fix: Bad detection of PDF format.
This commit is contained in:
parent
9bbe5014e6
commit
840dcfec38
@ -105,14 +105,18 @@ function dolGetModulesDirs($subdir='')
|
|||||||
/**
|
/**
|
||||||
* Try to guess default paper format according to language into $langs
|
* Try to guess default paper format according to language into $langs
|
||||||
*
|
*
|
||||||
* @return string Defautl paper format code
|
* @param Translate $outputlangs Output lang to use to autodetect output format if setup not done
|
||||||
|
* @return string Default paper format code
|
||||||
*/
|
*/
|
||||||
function dol_getDefaultFormat()
|
function dol_getDefaultFormat($outputlangs='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$selected='EUA4';
|
$selected='EUA4';
|
||||||
if ($langs->defaultlang == 'ca_CA') $selected='CAP4'; // Canada
|
if (empty($outputlangs) || ! is_object($outputlangs)) $outputlangs=$langs;
|
||||||
if ($langs->defaultlang == 'en_US') $selected='USLetter'; // US
|
|
||||||
|
if ($outputlangs->defaultlang == 'ca_CA') $selected='CAP4'; // Canada
|
||||||
|
if ($outputlangs->defaultlang == 'en_US') $selected='USLetter'; // US
|
||||||
return $selected;
|
return $selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -174,7 +174,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
|
|
||||||
|
|
||||||
// Define format of output PDF
|
// Define format of output PDF
|
||||||
$formatarray=pdf_getFormat();
|
$formatarray=pdf_getFormat($langs);
|
||||||
$page_largeur = $formatarray['width'];
|
$page_largeur = $formatarray['width'];
|
||||||
$page_hauteur = $formatarray['height'];
|
$page_hauteur = $formatarray['height'];
|
||||||
$format = array($page_largeur,$page_hauteur);
|
$format = array($page_largeur,$page_hauteur);
|
||||||
|
|||||||
@ -31,9 +31,10 @@
|
|||||||
/**
|
/**
|
||||||
* Return array with format properties of default PDF format
|
* Return array with format properties of default PDF format
|
||||||
*
|
*
|
||||||
|
* @param Translate $outputlangs Output lang to use to autodetect output format if setup not done
|
||||||
* @return array Array('width'=>w,'height'=>h,'unit'=>u);
|
* @return array Array('width'=>w,'height'=>h,'unit'=>u);
|
||||||
*/
|
*/
|
||||||
function pdf_getFormat()
|
function pdf_getFormat($outputlangs='')
|
||||||
{
|
{
|
||||||
global $conf,$db;
|
global $conf,$db;
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ function pdf_getFormat()
|
|||||||
if (empty($conf->global->MAIN_PDF_FORMAT))
|
if (empty($conf->global->MAIN_PDF_FORMAT))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$pdfformat=dol_getDefaultFormat();
|
$pdfformat=dol_getDefaultFormat($outputlangs);
|
||||||
}
|
}
|
||||||
else $pdfformat=$conf->global->MAIN_PDF_FORMAT;
|
else $pdfformat=$conf->global->MAIN_PDF_FORMAT;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user