From 988774120cd75afdf368872ef0a2573c3f816b58 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 16 Sep 2018 11:42:20 +0200 Subject: [PATCH] Standardize and update code --- htdocs/fourn/ajax/getSupplierPrices.php | 4 ++-- htdocs/fourn/commande/dispatch.php | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) 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/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');