From b8df44167aef5ecb81d463e7d9453dd4f1b979b9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 12 Sep 2018 15:09:12 +0200 Subject: [PATCH] Standardize and update code --- .../commande/doc/doc_generic_order_odt.modules.php | 8 ++++---- .../contract/doc/doc_generic_contract_odt.modules.php | 4 ++-- .../expedition/doc/doc_generic_shipment_odt.modules.php | 8 ++++---- htdocs/core/modules/mailings/contacts1.modules.php | 7 +++---- htdocs/core/modules/mailings/fraise.modules.php | 6 +++--- 5 files changed, 16 insertions(+), 17 deletions(-) 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 166c7f389d1..5866e57233b 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 @@ -53,8 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; @@ -98,8 +98,8 @@ class doc_generic_order_odt extends ModelePDFCommandes { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array("errors","companies")); $form = new Form($this->db); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index b58a67a2cb0..f19cafc3dcf 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -52,8 +52,8 @@ class doc_generic_contract_odt extends ModelePDFContract { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9971c3acd81..41a5f2e992c 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -54,8 +54,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; @@ -99,8 +99,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array("errors","companies")); $form = new Form($this->db); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 45f404f276e..0ba38215c61 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -116,10 +116,9 @@ class mailing_contacts1 extends MailingTargets function formFilter() { global $langs; - $langs->load("companies"); - $langs->load("commercial"); - $langs->load("suppliers"); - $langs->load("categories"); + + // Load translation files required by the page + $langs->loadLangs(array("commercial","companies","suppliers","categories")); $s=''; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index ab0cca6e0d4..aa57e954f04 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -109,9 +109,9 @@ class mailing_fraise extends MailingTargets function formFilter() { global $conf, $langs; - $langs->load("members"); - $langs->load("categories"); - $langs->load("companies"); + + // Load translation files required by the page + $langs->loadLangs(array("members","companies","categories")); $form=new Form($this->db);