From 72f906683fd0cb02d4e42a20e0604490b3588d29 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 18 Sep 2018 11:02:18 +0200 Subject: [PATCH] Standardize and update code --- htdocs/core/lib/pdf.lib.php | 4 ++-- .../commande/doc/doc_generic_order_odt.modules.php | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 0e67b9a4c44..05df8f784da 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2105,8 +2105,8 @@ function pdf_getLinkedObjects($object,$outputlangs) } else if ($objecttype == 'shipping') { - $outputlangs->load('orders'); - $outputlangs->load('sendings'); + $outputlangs->loadLangs(array("orders", "sendings")); + foreach($objects as $x => $elementobject) { $order=null; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index a312e58cc55..ba9a9490daa 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -38,10 +38,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; */ class doc_generic_order_odt extends ModelePDFCommandes { - var $emetteur; // Objet societe qui emet + public $emetteur; // Objet societe qui emet - var $phpmin = array(5,2,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; + public $phpmin = array(5,4,0); // Minimum version of PHP required by module + public $version = 'dolibarr'; /** @@ -51,7 +51,7 @@ class doc_generic_order_odt extends ModelePDFCommandes */ function __construct($db) { - global $conf,$langs,$mysoc; + global $conf, $langs, $mysoc; // Load translation files required by the page $langs->loadLangs(array("main","companies")); @@ -213,10 +213,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); + $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->commande->dir_output) {