From a1b15f170ea05c2610cc2ec5d51729e6a4b7d26f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 17 Sep 2018 09:00:23 +0200 Subject: [PATCH 1/5] Standardize and update code --- htdocs/compta/sociales/class/chargesociales.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 3067242ae16..aa5786d0eb5 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -430,8 +430,9 @@ class ChargeSociales extends CommonObject { // phpcs:enable global $langs; - $langs->load('customers'); - $langs->load('bills'); + + // Load translation files required by the page + $langs->loadLangs(array("customers","bills")); if ($mode == 0 || $mode == 1) { From 484b36c5aa3a6a467d74e191431b64974187c3c8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 17 Sep 2018 09:31:32 +0200 Subject: [PATCH 2/5] Standardize and update code --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index f30e2aed325..f79e9eea53d 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1149,8 +1149,8 @@ class FormOther if ($nbboxactivated) { - $langs->load("boxes"); - $langs->load("projects"); + // Load translation files required by the page + $langs->loadLangs(array("boxes","projects")); $emptybox=new ModeleBoxes($db); From cd796bf682d991c3826accc8993c4c01bf7f15cc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 17 Sep 2018 12:29:21 +0200 Subject: [PATCH 3/5] Standardize and update code --- htdocs/core/class/html.formsms.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 1e8a35fe3a4..165a4069b87 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -101,9 +101,8 @@ class FormSms if (! is_object($form)) $form=new Form($this->db); - $langs->load("other"); - $langs->load("mails"); - $langs->load("sms"); + // Load translation files required by the page + $langs->loadLangs(array('other', 'mails', 'sms')); $soc=new Societe($this->db); if (!empty($this->withtosocid) && $this->withtosocid > 0) From b06516180b2b6f8295950a2efcfb2817b86fb020 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 17 Sep 2018 15:06:41 +0200 Subject: [PATCH 4/5] Standardize and update code --- .../modules/facture/doc/doc_generic_invoice_odt.modules.php | 4 ++-- .../doc/doc_generic_supplier_proposal_odt.modules.php | 6 +++--- .../core/modules/user/doc/doc_generic_user_odt.modules.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 75c84a58ba0..6788dca1367 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -98,8 +98,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array('companies', 'errors')); $form = new Form($this->db); diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index a7c2db68a26..d196ff48a11 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -95,10 +95,10 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal */ function info($langs) { - global $conf,$langs; + global $conf, $langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array('companies', 'errors')); $form = new Form($this->db); diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 041157f20a2..511e6b6ae85 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -93,10 +93,10 @@ class doc_generic_user_odt extends ModelePDFUser */ function info($langs) { - global $conf,$langs; + global $conf, $langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array('companies', 'errors')); $form = new Form($this->db); From d1a27b33fbf707b9bbdcd9091d1a5d5aba53352b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 17 Sep 2018 17:28:05 +0200 Subject: [PATCH 5/5] Standardize and update code --- .../doc/doc_generic_usergroup_odt.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index fbd2d1bb79d..b25d6f9487c 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; */ class doc_generic_usergroup_odt extends ModelePDFUserGroup { - 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'; /** @@ -50,10 +50,10 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup */ function __construct($db) { - global $conf,$langs,$mysoc; + global $conf, $langs, $mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array('companies', 'main')); $this->db = $db; $this->name = "ODT templates";