From f24a6ed4d608f38aab9c21be7bb3615f28202499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 19:03:41 +0200 Subject: [PATCH] loadlangs --- htdocs/cashdesk/admin/cashdesk.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/comm/action/document.php | 6 ++---- htdocs/comm/action/index.php | 6 ++---- htdocs/comm/action/info.php | 1 + htdocs/comm/action/list.php | 1 + htdocs/comm/action/pertype.php | 7 ++----- htdocs/comm/action/peruser.php | 7 ++----- htdocs/comm/admin/propal_extrafields.php | 5 ++--- htdocs/comm/admin/propaldet_extrafields.php | 5 ++--- htdocs/comm/card.php | 4 ++-- htdocs/comm/index.php | 2 +- htdocs/comm/mailing/advtargetemailing.php | 7 +++---- htdocs/comm/multiprix.php | 4 ++-- htdocs/comm/recap-client.php | 1 + htdocs/comm/remise.php | 5 ++--- htdocs/comm/remx.php | 5 ++--- 17 files changed, 29 insertions(+), 41 deletions(-) diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 8d3d62e169a..f4af16b3739 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -38,7 +38,7 @@ if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) if (!$user->admin) accessforbidden(); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin", "cashdesk")); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index a09214d7d26..1d6a0286b68 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda")); $action=GETPOST('action','alpha'); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 1bbe5ddc6fc..43e5b89f115 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -36,10 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load("companies"); -$langs->load("commercial"); -$langs->load("other"); -$langs->load("bills"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'commercial', 'other', 'bills')); $id = GETPOST('id', 'int'); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d967d94e9e1..a8e6f33b950 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -116,10 +116,8 @@ if (GETPOST('viewday') || $action == 'show_day') { $action='show_day'; $day=($day?$day:date("d")); } // View by day - -$langs->load("agenda"); -$langs->load("other"); -$langs->load("commercial"); +// Load translation files required by the page +$langs->loadLangs(array('agenda', 'other', 'commercial')); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agenda')); diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 9bcf1d2b9cd..9a043a13690 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -33,6 +33,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } +// Load translation files required by the page $langs->load("commercial"); $id = GETPOST('id','int'); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index c9a0f1f9d49..0ac7dae09ee 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +// Load translation files required by the page $langs->loadLangs(array("users","companies","agenda","commercial")); $action=GETPOST('action','alpha'); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 1657166bd3d..883d6594bab 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -136,11 +136,8 @@ if (GETPOST('viewyear','alpha') || $action == 'show_year') { $action='show_year'; } // View by year - -$langs->load("users"); -$langs->load("agenda"); -$langs->load("other"); -$langs->load("commercial"); +// Load translation files required by the page +$langs->loadLangs(array('users', 'agenda', 'other', 'commercial')); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agenda')); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f6939ddc2b6..7bd620fc225 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -136,11 +136,8 @@ if (GETPOST('viewday','alpha') || $action == 'show_day') { $action='show_day'; $day=($day?$day:date("d")); } // View by day - -$langs->load("users"); -$langs->load("agenda"); -$langs->load("other"); -$langs->load("commercial"); +// Load translation files required by the page +$langs->loadLangs(array('users', 'agenda', 'other', 'commercial')); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agenda')); diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 3c95c39c88d..6a6aa12862a 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -28,9 +28,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load('propal'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'admin', 'propal')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 9c85504d458..49784228fe6 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -35,9 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("propal"); +// Load translation files required by the page +$langs->loadlangs(array('admin', 'other', 'propal')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index f74f9d777e8..f5ddc38e52c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -45,8 +45,8 @@ if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/c if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -$langs->load("companies"); -$langs->load('banks'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'banks')); if (! empty($conf->contrat->enabled)) $langs->load("contracts"); if (! empty($conf->commande->enabled)) $langs->load("orders"); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index c818659683f..e90a821b5e3 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -37,7 +37,7 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn if (! $user->rights->societe->lire) accessforbidden(); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("commercial", "propal")); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index d39feb3784d..8d1a98a2745 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/mailings/advthirdparties.modules require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -// Translations -$langs->load("mails"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('mails', 'companies')); if (! empty($conf->categorie->enabled)) { $langs->load("categories"); } @@ -976,4 +975,4 @@ if ($object->fetch($id) >= 0) { } llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index dd4e6cef1fa..1e8c5c82cf4 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -27,8 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -$langs->load("orders"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('orders', 'companies')); $id = GETPOST('id','int'); $_socid = GETPOST("id",'int'); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 71add817dc5..6cd41c6c658 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -26,6 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +// Load translation files required by the page $langs->load("companies"); if (! empty($conf->facture->enabled)) $langs->load("bills"); diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index ba3a6a172fd..6f3287b8831 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -26,9 +26,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -$langs->load("companies"); -$langs->load("orders"); -$langs->load("bills"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'orders', 'bills')); $id=GETPOST("id",'int'); diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index b580684af7e..3eec109e6b3 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; -$langs->load("orders"); -$langs->load("bills"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('orders', 'bills', 'companies')); $id=GETPOST('id','int');