diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index b32bb39185b..8ef79639e05 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -46,11 +46,8 @@ if (! empty($conf->contrat->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcontract.class.php'; } - -$langs->load('bills'); -$langs->load('compta'); -$langs->load('admin'); -$langs->load("interventions"); +// Load translation files required by the page +$langs->loadLangs(array("interventions","admin","compta","bills")); // Security check $id=(GETPOST('fichinterid', 'int')?GETPOST('fichinterid', 'int'):GETPOST('id', 'int')); diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 7a68bef34ec..b3d5247e67d 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -49,10 +49,8 @@ $endyear=$year; $object_status=GETPOST('object_status'); -$langs->load('interventions'); -$langs->load('companies'); -$langs->load('other'); -$langs->load('suppliers'); +// Load translation files required by the page +$langs->loadLangs(array("interventions","suppliers","companies","other")); /* diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index eeb2c1113f6..ae407d5544d 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -34,8 +34,8 @@ $idprod=GETPOST('idprod','int'); $prices = array(); -$langs->load('stocks'); -$langs->load('margins'); +// Load translation files required by the page +$langs->loadLangs(array("stocks","margins")); /* diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index f62ccd03331..85739bdb6ef 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -33,10 +33,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("facture"); -$langs->load("orders"); -$langs->load("sendings"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array("facture","orders","sendings","companies")); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 6aa9b5ca127..44b10bf6f88 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -5,9 +5,9 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2014 Cedric Gross - * Copyright (C) 2016 Florian Henry + * Copyright (C) 2016 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,13 +40,9 @@ require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; -$langs->load('orders'); -$langs->load('sendings'); -$langs->load('companies'); -$langs->load('bills'); -$langs->load('deliveries'); -$langs->load('products'); -$langs->load('stocks'); +// Load translation files required by the page +$langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks")); + if (! empty($conf->productbatch->enabled)) $langs->load('productbatch'); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 41e982284fc..8aa4da9c307 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -38,14 +38,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('orders'); -$langs->load('other'); -$langs->load('sendings'); -$langs->load('companies'); -$langs->load('bills'); -$langs->load('deliveries'); -$langs->load('products'); -$langs->load('stocks'); +// Load translation files required by the page +$langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks","other")); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 1d5cfc2097b..59e7b82e488 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -34,8 +34,8 @@ $orderid = GETPOST('orderid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande'); -$langs->load("suppliers"); -$langs->load("orders"); +// Load translation files required by the page +$langs->loadLangs(array("suppliers", "orders")); /* diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 747247a38c2..dee7a83bc6a 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -33,10 +33,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("orders"); -$langs->load("suppliers"); -$langs->load("companies"); -$langs->load('stocks'); +// Load translation files required by the page +$langs->loadLangs(array("suppliers", "orders", "companies", "stocks")); $id=GETPOST('id','int'); $ref=GETPOST('ref','alpha'); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index d44c1348b15..288b43d200b 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Marcos García - * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,10 +32,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("orders"); -$langs->load("suppliers"); -$langs->load("companies"); -$langs->load('stocks'); +// Load translation files required by the page +$langs->loadLangs(array("suppliers", "orders", "companies", "stocks")); $id = GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'); $ref = GETPOST('ref'); diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 1409fb5ea78..9b9743f201f 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin @@ -8,7 +8,7 @@ * Copyright (C) 2012-2017 Juanjo Menent * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,9 +41,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } -$langs->load('orders'); -$langs->load('deliveries'); -$langs->load('companies'); +// Load translation files required by the page +$langs->loadLangs(array("orders", "companies", "deliveries")); if (! $user->rights->fournisseur->facture->creer) accessforbidden(); @@ -105,9 +104,9 @@ if (($action == 'create' || $action == 'add') && ! $error) { if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - $langs->load('bills'); - $langs->load('products'); - $langs->load('main'); + // Load translation files required by the page + $langs->loadLangs(array("bills", "main", "products")); + if (isset($_GET['orders_to_invoice'])) { $orders_id = GETPOST('orders_to_invoice','',1); $n = count($orders_id);