From cbed5c83496e8e0a670981ff5d43359af61fcf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 15:41:32 +0200 Subject: [PATCH 01/17] loadlangs --- htdocs/compta/index.php | 3 +-- htdocs/compta/paiement.php | 5 +---- htdocs/ecm/dir_card.php | 4 +--- htdocs/ecm/file_card.php | 10 +--------- htdocs/imports/import.php | 4 +--- htdocs/index.php | 5 +---- htdocs/main.inc.php | 15 +++++---------- 7 files changed, 11 insertions(+), 35 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 12a4ecee052..88f4272deef 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -45,8 +45,7 @@ if (! empty($conf->tax->enabled)) //if (!$user->rights->compta->general->lire) // accessforbidden(); -$langs->load("compta"); -$langs->load("bills"); +$langs->loadLangs(array('compta', 'bills')); if (! empty($conf->commande->enabled)) $langs->load("orders"); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 8b6956a3942..1e992eab959 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -35,10 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -$langs->load('companies'); -$langs->load('bills'); -$langs->load('banks'); -$langs->load('multicurrency'); +$langs->loadLangs(array('companies', 'bills', 'banks', 'multicurrency')); $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm'); diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 14f0ee18e8c..f47d21174b1 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -30,9 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; // Load traductions files -$langs->load("ecm"); -$langs->load("companies"); -$langs->load("other"); +$langs->loadLangs(array('ecm', 'companies', 'other')); $action = GETPOST('action','alpha'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index e0926e0f777..b7b7e800a74 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -29,15 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; // Load traductions files -$langs->load("ecm"); -$langs->load("companies"); -$langs->load("other"); -$langs->load("users"); -$langs->load("orders"); -$langs->load("propal"); -$langs->load("bills"); -$langs->load("contracts"); -$langs->load("categories"); +$langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal', 'bills', 'contracts', 'categories')); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 08d3495c33c..300c62a71bd 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -32,9 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php'; -$langs->load("exports"); -$langs->load("compta"); -$langs->load("errors"); +$langs->loadLangs(array('exports', 'compta', 'errors')); // Security check $result=restrictedArea($user, 'import'); diff --git a/htdocs/index.php b/htdocs/index.php index 99b5f1ade7d..d9277be12f0 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -110,10 +110,7 @@ print '
'; */ $boxstat=''; -$langs->load("commercial"); -$langs->load("bills"); -$langs->load("orders"); -$langs->load("contracts"); +$langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (empty($user->societe_id)) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index eaea0dc420c..6187eefbd8f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -474,8 +474,7 @@ if (! defined('NOLOGIN')) if (! $ok) { dol_syslog('Bad value for code, connexion refused'); - $langs->load('main'); - $langs->load('errors'); + $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); $test=false; @@ -552,8 +551,7 @@ if (! defined('NOLOGIN')) if (! $login) { dol_syslog('Bad password, connexion refused',LOG_DEBUG); - $langs->load('main'); - $langs->load('errors'); + $langs->loadLangs(array('main', 'errors')); // Bad password. No authmode has found a good password. // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions @@ -602,8 +600,7 @@ if (! defined('NOLOGIN')) if ($resultFetchUser == 0) { - $langs->load('main'); - $langs->load('errors'); + $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); @@ -661,8 +658,7 @@ if (! defined('NOLOGIN')) if ($resultFetchUser == 0) { - $langs->load('main'); - $langs->load('errors'); + $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); @@ -935,8 +931,7 @@ dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.GETPOST('action',' // Load main languages files if (! defined('NOREQUIRETRAN')) { - $langs->load("main"); - $langs->load("dict"); + $langs->loadLangs(array('main', 'dict')); } // Define some constants used for style of arrays From 0a90f2d6904c966a8cbb0f1213dbad1a633011cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 15:50:03 +0200 Subject: [PATCH 02/17] loadlangs --- htdocs/commande/list.php | 2 +- htdocs/margin/agentMargins.php | 5 +---- htdocs/margin/checkMargins.php | 7 ++----- htdocs/margin/customerMargins.php | 5 +---- htdocs/margin/productMargins.php | 5 +---- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 8ff8a32a9ff..da4734a3f80 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -420,7 +420,7 @@ if ($resql) if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); if ($search_town != '') $param.='&search_town='.urlencode($search_town); if ($search_zip != '') $param.='&search_zip='.urlencode($search_zip); - if ($search_state != '') $param.='&search_state='.urlencode$search_state); + if ($search_state != '') $param.='&search_state='.urlencode($search_state); if ($search_country != '') $param.='&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($search_product_category != '') $param.='&search_product_category='.urlencode($search_product_category); diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 9867a3da5ec..33b693cb3db 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -29,10 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load("margins"); +$langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $mesg = ''; diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index d1c682540ff..fced36e8945 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -29,10 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php'; -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load("margins"); +$langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $action = GETPOST('action','alpha'); $massaction = GETPOST('massaction','alpha'); @@ -324,4 +321,4 @@ print ''; $db->free($result); llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index dfa97bd7536..90b0b9d11ca 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -28,10 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load("margins"); +$langs->loadLangs(array('companies', 'bills', 'products', 'margins')); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index ad1fc773bd3..160be439b7c 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -28,10 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load("margins"); +$langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); From 9cd7bb3f587da99d92e0f0965ce567c4dd1da3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 16:03:19 +0200 Subject: [PATCH 03/17] loadlangs --- htdocs/compta/index.php | 1 + htdocs/compta/paiement.php | 1 + htdocs/ecm/dir_card.php | 2 +- htdocs/ecm/file_card.php | 2 +- htdocs/fourn/card.php | 15 +++++++++------ htdocs/imports/import.php | 1 + htdocs/index.php | 1 + htdocs/main.inc.php | 5 +++++ htdocs/margin/agentMargins.php | 1 + htdocs/margin/checkMargins.php | 1 + htdocs/margin/customerMargins.php | 1 + htdocs/margin/productMargins.php | 1 + 12 files changed, 24 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 88f4272deef..73b3ede941f 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -45,6 +45,7 @@ if (! empty($conf->tax->enabled)) //if (!$user->rights->compta->general->lire) // accessforbidden(); +// Load translation files required by page $langs->loadLangs(array('compta', 'bills')); if (! empty($conf->commande->enabled)) $langs->load("orders"); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 1e992eab959..7bec5e79491 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +// Load translation files required by page $langs->loadLangs(array('companies', 'bills', 'banks', 'multicurrency')); $action = GETPOST('action','alpha'); diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index f47d21174b1..982fa045d32 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; -// Load traductions files +// Load translation files required by page $langs->loadLangs(array('ecm', 'companies', 'other')); $action = GETPOST('action','alpha'); diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index b7b7e800a74..b1b45141f4f 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; -// Load traductions files +// Load translation files required by page $langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal', 'bills', 'contracts', 'categories')); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 6dff84c5742..906dbda4f6e 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -37,12 +37,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -$langs->load('companies'); -$langs->load('suppliers'); -$langs->load('products'); -$langs->load('bills'); -$langs->load('orders'); -$langs->load('commercial'); +// Load translation files required by page +$langs->loadLangs(array( + 'companies', + 'suppliers', + 'products', + 'bills', + 'orders', + 'commercial', +)); $action = GETPOST('action','aZ09'); $cancelbutton = GETPOST('cancel','alpha'); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 300c62a71bd..596c4634da4 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php'; +// Load translation files required by page $langs->loadLangs(array('exports', 'compta', 'errors')); // Security check diff --git a/htdocs/index.php b/htdocs/index.php index d9277be12f0..b7e8aed91d3 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -110,6 +110,7 @@ print '
'; */ $boxstat=''; +// Load translation files required by page $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (empty($user->societe_id)) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6187eefbd8f..ffa3d59c373 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -474,6 +474,7 @@ if (! defined('NOLOGIN')) if (! $ok) { dol_syslog('Bad value for code, connexion refused'); + // Load translation files required by page $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); @@ -551,6 +552,7 @@ if (! defined('NOLOGIN')) if (! $login) { dol_syslog('Bad password, connexion refused',LOG_DEBUG); + // Load translation files required by page $langs->loadLangs(array('main', 'errors')); // Bad password. No authmode has found a good password. @@ -600,6 +602,7 @@ if (! defined('NOLOGIN')) if ($resultFetchUser == 0) { + // Load translation files required by page $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); @@ -658,6 +661,7 @@ if (! defined('NOLOGIN')) if ($resultFetchUser == 0) { + // Load translation files required by page $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); @@ -931,6 +935,7 @@ dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.GETPOST('action',' // Load main languages files if (! defined('NOREQUIRETRAN')) { + // Load translation files required by page $langs->loadLangs(array('main', 'dict')); } diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 33b693cb3db..7b47e8083dc 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; +// Load translation files required by page $langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $mesg = ''; diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index fced36e8945..4775f8b5885 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php'; +// Load translation files required by page $langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $action = GETPOST('action','alpha'); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 90b0b9d11ca..fa919da9716 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; +// Load translation files required by page $langs->loadLangs(array('companies', 'bills', 'products', 'margins')); // Security check diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 160be439b7c..f147f334166 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; +// Load translation files required by page $langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $id = GETPOST('id', 'int'); From e87ff4d9b099a8868fed20a43c1f24812165592f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 16:24:54 +0200 Subject: [PATCH 04/17] loadlangs --- htdocs/user/admin/group_extrafields.php | 4 ++-- htdocs/user/admin/user_extrafields.php | 4 ++-- htdocs/user/agenda_extsites.php | 5 ++--- htdocs/user/bank.php | 9 ++------- htdocs/user/card.php | 7 ++----- htdocs/user/clicktodial.php | 4 ++-- htdocs/user/document.php | 4 ++-- htdocs/user/group/card.php | 4 ++-- htdocs/user/group/ldap.php | 6 ++---- htdocs/user/group/list.php | 1 + htdocs/user/group/perms.php | 4 ++-- htdocs/user/hierarchy.php | 4 ++-- htdocs/user/home.php | 1 + htdocs/user/info.php | 1 + htdocs/user/ldap.php | 6 ++---- htdocs/user/list.php | 5 ++--- htdocs/user/note.php | 6 ++---- htdocs/user/notify/card.php | 6 ++---- htdocs/user/param_ihm.php | 9 ++------- htdocs/user/passwordforgotten.php | 7 ++----- htdocs/user/perms.php | 4 ++-- 21 files changed, 39 insertions(+), 62 deletions(-) diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 7277fa9f03b..0dd5cf9ce7e 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -29,8 +29,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("users"); -$langs->load("admin"); +// Load translation files required by page +$langs->loadLangs(array('users', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index c6b55d760f3..bf704af2003 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -28,8 +28,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("users"); -$langs->load("admin"); +// Load translation files required by page +$langs->loadLangs(array('users', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index ced0e759f31..1764ab5baf4 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -33,9 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -$langs->load("agenda"); -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by page +$langs->loadLangs(array('agenda', 'admin', 'other')); $def = array(); $actiontest=GETPOST('test','alpha'); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 9356828f884..7f11911a46b 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -36,13 +36,8 @@ if (! empty($conf->holiday->enabled)) require_once DOL_DOCUMENT_ROOT.'/holiday/c if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; -$langs->load("companies"); -$langs->load("commercial"); -$langs->load("banks"); -$langs->load("bills"); -$langs->load("trips"); -$langs->load("holiday"); -$langs->load("salaries"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'commercial', 'banks', 'bills', 'trips', 'holiday', 'salaries')); $id = GETPOST('id','int'); $bankid = GETPOST('bankid','int'); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index ddab0daed0c..e58b7154487 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -89,11 +89,8 @@ if (!$canreaduser) { } if ($user->id <> $id && ! $canreaduser) accessforbidden(); -$langs->load("users"); -$langs->load("companies"); -$langs->load("ldap"); -$langs->load("admin"); -$langs->load('hrm'); +// Load translation files required by page +$langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm')); $object = new User($db); $extrafields = new ExtraFields($db); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 51e4364e2ba..16c5b4e0e73 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -25,8 +25,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; -$langs->load("users"); -$langs->load("admin"); +// Load translation files required by page +$langs->loadLangs(array('users', 'admin')); $action=GETPOST('action','alpha'); $id=GETPOST('id','int'); diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 9e665bd563b..a917a972ddc 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -$langs->load("users"); -$langs->load('other'); +// Load translation files required by page +$langs->loadLangs(array('users', 'other')); $action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm'); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 11850940f85..47a5a5df9eb 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -42,8 +42,8 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $candisableperms=($user->admin || $user->rights->user->group_advance->delete); } -$langs->load("users"); -$langs->load("other"); +// Load translation files required by page +$langs->loadLangs(array('users', 'other')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index 2deab4b56a2..bb9d05d59f1 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -29,10 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; -$langs->load("companies"); -$langs->load("ldap"); -$langs->load("users"); -$langs->load("admin"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'ldap', 'users', 'admin')); // Users/Groups management only in master entity if transverse mode if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index c5dcb7a53bd..a76d6efd457 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -39,6 +39,7 @@ if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global- accessforbidden(); } +// Load translation files required by page $langs->load("users"); $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml')); diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index ef5d286ca11..c1f8d1fe5b0 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->load("users"); -$langs->load("admin"); +// Load translation files required by page +$langs->loadLangs(array('users', 'admin')); $id=GETPOST('id','int'); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 930e911afaa..0b1842dabde 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; if (! $user->rights->user->user->lire && ! $user->admin) accessforbidden(); -$langs->load("users"); -$langs->load("companies"); +// Load translation files required by page +$langs->loadLangs(array('users', 'companies')); // Security check (for external users) $socid=0; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 64162d47a8f..5dbec430687 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -33,6 +33,7 @@ if (! $user->rights->user->user->lire && ! $user->admin) exit; } +// Load translation files required by page $langs->load("users"); $canreadperms=true; diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 9e349675625..19ecf15eb65 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +// Load translation files required by page $langs->load("users"); // Security check diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 79a1fd38bb5..4f9eac61d9f 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -27,10 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; -$langs->load("users"); -$langs->load("admin"); -$langs->load("companies"); -$langs->load("ldap"); +// Load translation files required by page +$langs->loadLangs(array('users', 'admin', 'companies', 'ldap')); $id = GETPOST('id', 'int'); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userldap'; // To manage different context of search diff --git a/htdocs/user/list.php b/htdocs/user/list.php index b3b0ff91ff8..77e52f1f6a2 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -30,9 +30,8 @@ require '../main.inc.php'; if (! $user->rights->user->user->lire && ! $user->admin) accessforbidden(); -$langs->load("users"); -$langs->load("companies"); -$langs->load('hrm'); + // Load translation files required by page +$langs->loadLangs(array('users', 'companies', 'hrm')); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userlist'; // To manage different context of search diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 2f027f38504..5b787ded7b0 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -31,10 +31,8 @@ $id = GETPOST('id','int'); $action = GETPOST('action','aZ09'); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'usernote'; // To manage different context of search -$langs->load("companies"); -$langs->load("members"); -$langs->load("bills"); -$langs->load("users"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'members', 'bills', 'users')); $object = new User($db); $object->fetch($id, '', '', 1); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 2bcf4fc0663..cac9a3d476b 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -31,10 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; -$langs->load("companies"); -$langs->load("mails"); -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'mails', 'admin', 'other')); $id = GETPOST("id",'int'); $action = GETPOST('action','aZ09'); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c797a11ccad..b0473e15c49 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -27,13 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; -$langs->load("companies"); -$langs->load("products"); -$langs->load("admin"); -$langs->load("users"); -$langs->load("languages"); -$langs->load("projects"); -$langs->load("members"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members')); // Defini si peux lire/modifier permisssions $canreaduser=($user->admin || $user->rights->user->user->lire); diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 584fa6f2427..cf13529d23a 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -31,11 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; -$langs->load("errors"); -$langs->load("users"); -$langs->load("companies"); -$langs->load("ldap"); -$langs->load("other"); +// Load translation files required by page +$langs->loadLangs(array('errors', 'users', 'companies', 'ldap', 'other')); // Security check if (! empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 77277b54102..0a8e2bbbb80 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("users"); -$langs->load("admin"); +// Load translation files required by page +$langs->loadLangs(array('users', 'admin')); $id=GETPOST('id', 'int'); $action=GETPOST('action', 'alpha'); From 812b1826800ed09a5a5e9757c8badded2e1e1aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 16:35:29 +0200 Subject: [PATCH 05/17] loadlangs --- htdocs/adherents/card.php | 2 +- htdocs/compta/index.php | 2 +- htdocs/ecm/dir_add_card.php | 2 +- htdocs/ecm/index.php | 2 +- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/ftp/index.php | 6 ++--- htdocs/stripe/admin/stripe.php | 7 ++--- htdocs/stripe/charge.php | 7 ++--- htdocs/stripe/payment.php | 7 ++--- htdocs/stripe/transaction.php | 7 ++--- .../admin/supplier_proposal_extrafields.php | 5 ++-- .../supplier_proposaldet_extrafields.php | 5 ++-- htdocs/supplier_proposal/card.php | 11 ++------ htdocs/supplier_proposal/contact.php | 1 + htdocs/supplier_proposal/document.php | 5 ++-- htdocs/supplier_proposal/index.php | 4 +-- htdocs/supplier_proposal/info.php | 4 +-- htdocs/supplier_proposal/list.php | 9 ++----- htdocs/supplier_proposal/note.php | 6 ++--- htdocs/ticketsup/card.php | 2 +- htdocs/ticketsup/contact.php | 5 ++-- htdocs/ticketsup/document.php | 1 + htdocs/ticketsup/history.php | 6 ++--- htdocs/ticketsup/index.php | 6 ++--- htdocs/ticketsup/list.php | 2 +- htdocs/ticketsup/new.php | 6 ++--- htdocs/user/clicktodial.php | 26 +++++++++---------- 28 files changed, 57 insertions(+), 93 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 06eb0b2b40a..990c8349e33 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("companies","bills","members","users","other")); $action=GETPOST('action','alpha'); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 73b3ede941f..0416fa875e0 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -45,7 +45,7 @@ if (! empty($conf->tax->enabled)) //if (!$user->rights->compta->general->lire) // accessforbidden(); -// Load translation files required by page +// Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); if (! empty($conf->commande->enabled)) $langs->load("orders"); diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 4389543faa8..5dab56b29a0 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/htmlecm.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; -// Load traductions files +// Load translation files required by the page $langs->loadLangs(array("ecm","companies","other","users","orders","propal","bills","contracts","categories")); // Get parameters diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 5895cc9b793..ae11ebbd479 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; -// Load traductions files +// Load translation files required by the page $langs->loadLangs(array("ecm","companies","other","users","orders","propal","bills","contracts")); // Security check diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 19c607b1612..382312e4434 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; -// Load traductions files +// Load translation files required by the page $langs->loadLangs(array("ecm","companies","other","users","orders","propal","bills","contracts")); // Security check diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 8736de8a544..bbf4fbbec1c 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; -// Load traductions files +// Load translation files required by the page $langs->loadLangs(array("ecm","companies","other","users","orders","propal","bills","contracts")); // Security check diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index c9172bfd0c8..9881b89c6f1 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -27,10 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; -// Load traductions files -$langs->load("ftp"); -$langs->load("companies"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array('ftp', 'companies', 'other')); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 62ca1000822..24224a4f18c 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -32,11 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $servicename='Stripe'; -$langs->load("admin"); -$langs->load("other"); -$langs->load("paypal"); -$langs->load("paybox"); -$langs->load("stripe"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'paypal', 'paybox', 'stripe')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 90779d24962..1464c9c2e6b 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -27,11 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; -$langs->load("compta"); -$langs->load("salaries"); -$langs->load("bills"); -$langs->load("hrm"); -$langs->load("stripe"); +// Load translation files required by the page +$langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe')); // Security check $socid = GETPOST("socid","int"); diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 68a695e2f33..b0d8da92ba5 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -39,11 +39,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; -$langs->load('companies'); -$langs->load('bills'); -$langs->load('banks'); -$langs->load('multicurrency'); -$langs->load('stripe@stripe'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'bills', 'banks', 'multicurrency', 'stripe')); $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm'); diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 28848106361..fc7ffa828e0 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -27,11 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; -$langs->load("compta"); -$langs->load("salaries"); -$langs->load("bills"); -$langs->load("hrm"); -$langs->load("stripe"); +// Load translation files required by the page +$langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe')); // Security check $socid = GETPOST("socid","int"); diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index cea668cfae2..545d953e753 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -22,9 +22,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load('supplier_proposal'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'admin', 'supplier_proposal')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index 41101ec7759..1acf85b45a3 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("supplier_proposal"); + // Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'supplier_proposal')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 3ff366173fc..0eed393b157 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -46,15 +46,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } -$langs->load('companies'); -$langs->load('supplier_proposal'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('propal'); -$langs->load('orders'); -$langs->load('products'); -$langs->load("deliveries"); -$langs->load('sendings'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'supplier_proposal', 'compta', 'bills', 'propal', 'orders', 'products', 'deliveries', 'sendings')); if (! empty($conf->margin->enabled)) $langs->load('margins'); diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 3773aab6f0c..fdf51406e8e 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +// Load translation files required by the page $langs->loadLangs(array("propal","facture","orders","sendings","companies")); $id = GETPOST('id', 'int'); diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 2be5dae222b..12de448829e 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -35,9 +35,8 @@ 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('compta'); -$langs->load('other'); +// Load translation files required by the page +$langs->loadLangs(array('compta', 'other')); $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 17565e7f140..26880a7b350 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -27,8 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; -$langs->load("supplier_proposal"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('supplier_proposal', 'companies')); // Security check $socid=GETPOST('socid','int'); diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 9724e86b1d5..3f83b4dca88 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -32,8 +32,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('supplier_proposal'); -$langs->load('compta'); +// Load translation files required by the page +$langs->loadLangs(array('supplier_proposal', 'compta')); $id=GETPOST('id','int'); $socid=GETPOST('socid','int'); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index aa5c7e70ab3..13359e7b446 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -42,13 +42,8 @@ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load('companies'); -$langs->load('propal'); -$langs->load('supplier_proposal'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('orders'); -$langs->load('products'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'propal', 'supplier_proposal', 'compta', 'bills', 'orders', 'products')); $socid=GETPOST('socid','int'); diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 57c6fbed502..ba54859a207 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -32,10 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } - -$langs->load('supplier_proposal'); -$langs->load('compta'); -$langs->load('bills'); +// Load translation files required by the page +$langs->loadLangs(array('supplier_proposal', 'compta', 'bills')); $id = GETPOST('id','int'); $ref=GETPOST('ref','alpha'); diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index 4b186867302..b89887f84e1 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -41,7 +41,7 @@ if (!empty($conf->contrat->enabled)) { include_once DOL_DOCUMENT_ROOT . '/core/class/html.formcontract.class.php'; } -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("companies","other","ticketsup")); // Get parameters diff --git a/htdocs/ticketsup/contact.php b/htdocs/ticketsup/contact.php index 7202cba8dd2..f6938b1a7fc 100644 --- a/htdocs/ticketsup/contact.php +++ b/htdocs/ticketsup/contact.php @@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("ticketsup"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'ticketsup')); // Get parameters $socid = GETPOST("socid", 'int'); diff --git a/htdocs/ticketsup/document.php b/htdocs/ticketsup/document.php index 3ec98fe1635..c6bc116dee4 100644 --- a/htdocs/ticketsup/document.php +++ b/htdocs/ticketsup/document.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +// Load translation files required by page $langs->loadLangs(array("companies","other","ticketsup","mails")); $id = GETPOST('id', 'int'); diff --git a/htdocs/ticketsup/history.php b/htdocs/ticketsup/history.php index c6de1d7c3c6..da08574aa3f 100644 --- a/htdocs/ticketsup/history.php +++ b/htdocs/ticketsup/history.php @@ -33,10 +33,8 @@ if (!class_exists('Contact')) { include DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; } -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("ticketsup"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'other', 'ticketsup')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/ticketsup/index.php b/htdocs/ticketsup/index.php index 16c4fc15bf7..dfd2455e74a 100644 --- a/htdocs/ticketsup/index.php +++ b/htdocs/ticketsup/index.php @@ -25,10 +25,8 @@ require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/actions_ticketsup.class.php'; require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/ticketsupstats.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php'; -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("ticketsup"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'other', 'ticketsup')); $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index d2127fd875f..4a91b9cc4ac 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -32,7 +32,7 @@ include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("ticketsup","companies","other","projects")); diff --git a/htdocs/ticketsup/new.php b/htdocs/ticketsup/new.php index 9fe7411186a..6ab7d5ee560 100644 --- a/htdocs/ticketsup/new.php +++ b/htdocs/ticketsup/new.php @@ -27,10 +27,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticketsup.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("ticketsup"); +// Load translation files required by page +$langs->loadLangs(array('companies', 'other', 'ticketsup')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 16c5b4e0e73..a4c4e90f99d 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -63,7 +63,7 @@ if (empty($reshook)) { $edituser->clicktodial_poste = GETPOST("poste"); $result = $edituser->update_clicktodial(); - if ($result < 0) + if ($result < 0) { setEventMessages($edituser->error, $edituser->errors, 'errors'); } @@ -92,11 +92,11 @@ if ($id > 0) $title = $langs->trans("User"); - + print '
'; print ''; print ''; - + dol_fiche_head($head, 'clicktodial', $title, -1, 'user'); $linkback = ''; @@ -104,17 +104,17 @@ if ($id > 0) if ($user->rights->user->user->lire || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } - + dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); - + print '
'; print '
'; - + // Edit mode if ($action == 'edit') { print ''; - + if ($user->admin) { print ''; @@ -177,15 +177,15 @@ if ($id > 0) print ''; print ''; print ""; - + print ''; print ''; print ''; - + print ''; print ''; print "\n"; - + print "
ClickToDial URL
ClickToDial '.$langs->trans("IdPhoneCaller").''.(! empty($object->clicktodial_poste)?$object->clicktodial_poste:'').'
ClickToDial '.$langs->trans("Login").''.(! empty($object->clicktodial_login)?$object->clicktodial_login:'').'
ClickToDial '.$langs->trans("Password").''.preg_replace('/./','*',(! empty($object->clicktodial_password)?$object->clicktodial_password:'')).'
\n"; } @@ -197,11 +197,11 @@ if ($id > 0) print '     '; print ''; print '
'; - } - + } + print '
'; print ''; - + /* * Barre d'actions */ From 58e5715ac30d09bcbc258e8469cf18c159bf9e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 17:57:30 +0200 Subject: [PATCH 06/17] loadlangs --- htdocs/fichinter/admin/fichinter_extrafields.php | 6 ++---- htdocs/fichinter/admin/fichinterdet_extrafields.php | 6 ++---- htdocs/fichinter/card.php | 5 ++--- htdocs/fichinter/contact.php | 5 ++--- htdocs/fichinter/document.php | 6 ++---- htdocs/fichinter/index.php | 1 + htdocs/fichinter/info.php | 4 ++-- htdocs/fichinter/list.php | 5 ++--- htdocs/fichinter/note.php | 4 ++-- htdocs/modulebuilder/index.php | 1 + htdocs/modulebuilder/template/mymoduleindex.php | 1 + htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/modulebuilder/template/myobject_document.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/modulebuilder/template/myobject_note.php | 2 +- htdocs/opensurvey/index.php | 1 + htdocs/opensurvey/list.php | 1 + htdocs/paybox/admin/paybox.php | 6 ++---- htdocs/paypal/admin/paypal.php | 6 ++---- htdocs/printing/admin/printing.php | 5 ++--- htdocs/printing/index.php | 1 + htdocs/product/admin/dynamic_prices.php | 1 + htdocs/product/admin/price_rules.php | 4 ++-- htdocs/product/admin/product.php | 1 + htdocs/product/admin/product_extrafields.php | 5 ++--- htdocs/product/admin/product_lot_extrafields.php | 6 ++---- htdocs/product/admin/product_tools.php | 4 ++-- htdocs/product/composition/card.php | 5 ++--- htdocs/product/dynamic_price/editor.php | 4 ++-- 30 files changed, 47 insertions(+), 57 deletions(-) diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index 6116423bdec..40fd63d7639 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -30,10 +30,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("members"); -$langs->load('interventions'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'admin', 'members', 'interventions')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/fichinter/admin/fichinterdet_extrafields.php b/htdocs/fichinter/admin/fichinterdet_extrafields.php index df06bab1336..eab70d5d585 100644 --- a/htdocs/fichinter/admin/fichinterdet_extrafields.php +++ b/htdocs/fichinter/admin/fichinterdet_extrafields.php @@ -30,10 +30,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("members"); -$langs->load('interventions'); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'admin', 'members', 'interventions')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 540f897ffe5..b0d085838a8 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -51,9 +51,8 @@ if (! empty($conf->global->FICHEINTER_ADDON) && is_readable(DOL_DOCUMENT_ROOT ." require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("bills"); -$langs->load("companies"); -$langs->load("interventions"); +// Load translation files required by the page +$langs->loadLangs(array('bills', 'companies', 'interventions')); $id = GETPOST('id','int'); $ref = GETPOST('ref','alpha'); diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index d7be9c95cec..d3b2ea6f78e 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -31,9 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load("interventions"); -$langs->load("sendings"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('interventions', 'sendings', 'companies')); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 4c6d51e89fe..6e84f457eb1 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -38,10 +38,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("other"); -$langs->load("fichinter"); -$langs->load("companies"); -$langs->load("interventions"); +// Load translation files required by the page +$langs->loadLangs(array('other', 'fichinter', 'companies', 'interventions')); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 1a4068f5911..474c6774f26 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/fichinter/class/fichinter.class.php'; if (!$user->rights->ficheinter->lire) accessforbidden(); +// Load translation files required by the page $langs->load("interventions"); // Security check diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index 0a685999afe..fe3d14191d6 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -32,8 +32,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('companies'); -$langs->load("interventions"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'interventions')); $socid=0; $id = GETPOST('id','int'); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 87d8b366ef8..17a25071e68 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -33,9 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -$langs->load("companies"); -$langs->load("bills"); -$langs->load("interventions"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'bills', 'interventions')); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index cf15841dce9..cece45fdab5 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -31,8 +31,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('companies'); -$langs->load("interventions"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'interventions')); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1048dde3c51..c46d76ce4ba 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/modulebuilder.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; +// Load translation files required by the page $langs->loadLangs(array("admin", "modulebuilder", "other", "cron")); $action=GETPOST('action','aZ09'); diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 0b9eb9bf7ee..bf56d00ede0 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -41,6 +41,7 @@ if (! $res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +// Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule")); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 38f462a93c7..5c7303ba6a9 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -44,7 +44,7 @@ dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/myobject.lib.php'); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","other")); // Get parameters diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 5e7612053c6..9e2e48ce6cf 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -62,7 +62,7 @@ include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/myobject.lib.php'); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","other")); // Get parameters diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 124fa031487..c08a360835a 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/myobject.lib.php'); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","companies","other","mails")); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index eeeda4e3021..b81fee8bbcb 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -60,7 +60,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; dol_include_once('/mymodule/class/myobject.class.php'); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","other")); $action = GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 4ee7e9fb861..5b438c32a7c 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -40,7 +40,7 @@ if (! $res) die("Include of main fails"); dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/myobject.lib.php'); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","companies")); // Get parameters diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 93e913c1585..663d4ad704a 100644 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -32,6 +32,7 @@ if (!$user->rights->opensurvey->read) accessforbidden(); * View */ + // Load translation files required by the page $langs->load("opensurvey"); llxHeader(); diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 77934e68744..900168cafb5 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -58,6 +58,7 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="p.date_fin"; if (! $sortorder) $sortorder="DESC"; +// Load translation files required by the page $langs->load("opensurvey"); diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 1db6c1906a3..4c68abab520 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -29,10 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $servicename='PayBox'; -$langs->load("admin"); -$langs->load("other"); -$langs->load("paybox"); -$langs->load("paypal"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'paybox', 'paypal')); if (!$user->admin) accessforbidden(); diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 23bf26d375f..381151cac93 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -32,10 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $servicename='PayPal'; -$langs->load("admin"); -$langs->load("other"); -$langs->load("paypal"); -$langs->load("paybox"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'paypal', 'paybox')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 66d1b0ac6f3..96b9cad3849 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -30,9 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; require_once DOL_DOCUMENT_ROOT.'/printing/lib/printing.lib.php'; use OAuth\Common\Storage\DoliStorage; -$langs->load("admin"); -$langs->load("printing"); -$langs->load("oauth"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'printing', 'oauth')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php index 4fd21e6abc6..384d0834cc0 100644 --- a/htdocs/printing/index.php +++ b/htdocs/printing/index.php @@ -25,6 +25,7 @@ require '../main.inc.php'; include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; +// Load translation files required by the page $langs->load("printing"); diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index bd7fce52b77..348380e9b37 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_global_variable.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_global_variable_updater.class.php'; +// Load translation files required by the page $langs->load("products"); $id = GETPOST('id', 'int'); diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php index 088c0126417..0049daeaa7d 100644 --- a/htdocs/product/admin/price_rules.php +++ b/htdocs/product/admin/price_rules.php @@ -23,8 +23,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; -$langs->load("admin"); -$langs->load("products"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'products')); // Security check if (! $user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 63f10296212..bb214ffc06a 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; +// Load translation files required by the page $langs->loadLangs(array("admin","products")); // Security check diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 856151a8238..849b346244d 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -29,9 +29,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("products"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'admin', 'products')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/product/admin/product_lot_extrafields.php b/htdocs/product/admin/product_lot_extrafields.php index 20f3b9d30b9..be3651344ff 100644 --- a/htdocs/product/admin/product_lot_extrafields.php +++ b/htdocs/product/admin/product_lot_extrafields.php @@ -29,10 +29,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("products"); -$langs->load("productbatch"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'admin', 'products', 'productbatch')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index c9323f75823..291aba9bcf1 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; -$langs->load("admin"); -$langs->load("products"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'products')); // Security check if (! $user->admin) accessforbidden(); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 3dc10ec8f32..2167f15a7e5 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -33,9 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -$langs->load("bills"); -$langs->load("products"); -$langs->load("stocks"); +// Load translation files required by the page +$langs->loadLangs(array('bills', 'products', 'stocks')); $id=GETPOST('id','int'); $ref=GETPOST('ref','alpha'); diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index bcf18750981..9187775f8e9 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_expression.cl require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_global_variable.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; -$langs->load("products"); -$langs->load("accountancy"); //"Back" translation is on this file +// Load translation files required by the page +$langs->loadLangs(array('products', 'accountancy')); //"Back" translation is on this accountancy file $id = GETPOST('id', 'int'); $eid = GETPOST('eid', 'int'); From f53f7bbf40a4a5c9242e2fc4faa88165c9fd3609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 18:41:16 +0200 Subject: [PATCH 07/17] loadlangs --- htdocs/admin/accountant.php | 4 ++-- htdocs/admin/agenda.php | 5 ++--- htdocs/admin/agenda_extrafields.php | 5 ++--- htdocs/admin/agenda_extsites.php | 5 ++--- htdocs/admin/agenda_other.php | 5 ++--- htdocs/admin/agenda_reminder.php | 1 + htdocs/admin/agenda_xcal.php | 1 + htdocs/admin/bank.php | 2 +- htdocs/admin/bank_extrafields.php | 4 ++-- htdocs/admin/barcode.php | 1 + htdocs/admin/boxes.php | 4 ++-- htdocs/admin/chequereceipts.php | 2 +- htdocs/admin/clicktodial.php | 1 + htdocs/admin/commande.php | 6 ++---- htdocs/admin/company.php | 4 ++-- htdocs/admin/compta.php | 5 ++--- htdocs/admin/confexped.php | 5 ++--- htdocs/admin/const.php | 1 + htdocs/admin/contract.php | 2 +- htdocs/admin/dav.php | 1 + htdocs/admin/defaultvalues.php | 8 ++------ htdocs/admin/delais.php | 1 + htdocs/admin/dict.php | 1 + htdocs/admin/ecm.php | 3 ++- htdocs/admin/events.php | 2 +- htdocs/admin/expedition.php | 2 +- htdocs/admin/expedition_extrafields.php | 6 ++---- htdocs/admin/expeditiondet_extrafields.php | 5 ++--- htdocs/admin/expensereport.php | 6 ++---- htdocs/admin/expensereport_extrafields.php | 6 ++---- htdocs/admin/expensereport_ik.php | 4 ++-- htdocs/admin/expensereport_rules.php | 4 ++-- htdocs/admin/export.php | 7 +++---- htdocs/admin/external_rss.php | 1 + htdocs/admin/facture.php | 6 ++---- htdocs/admin/fckeditor.php | 4 ++-- htdocs/admin/fichinter.php | 6 ++---- htdocs/admin/geoipmaxmind.php | 2 +- htdocs/admin/ihm.php | 12 ++---------- htdocs/admin/index.php | 4 ++-- htdocs/admin/ldap.php | 1 + htdocs/admin/ldap_contacts.php | 2 +- htdocs/admin/ldap_groups.php | 2 +- htdocs/admin/ldap_members.php | 4 ++-- htdocs/admin/ldap_members_types.php | 4 ++-- htdocs/admin/ldap_users.php | 4 ++-- htdocs/admin/limits.php | 9 ++++----- htdocs/admin/livraison.php | 2 +- htdocs/admin/livraison_extrafields.php | 6 ++---- htdocs/admin/livraisondet_extrafields.php | 5 ++--- htdocs/admin/loan.php | 6 +++--- htdocs/admin/mailing.php | 2 +- htdocs/admin/mailman.php | 2 +- htdocs/admin/mails.php | 2 +- htdocs/admin/mails_emailing.php | 8 ++------ htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/menus.php | 1 + htdocs/admin/modulehelp.php | 4 ++-- htdocs/admin/modules.php | 1 + htdocs/admin/multicurrency.php | 5 ++--- htdocs/admin/notification.php | 9 ++------- htdocs/admin/oauth.php | 7 +++---- htdocs/admin/oauthlogintokens.php | 7 +++---- htdocs/admin/order_extrafields.php | 5 ++--- htdocs/admin/orderdet_extrafields.php | 5 ++--- htdocs/admin/payment.php | 2 +- htdocs/admin/pdf.php | 5 ++--- htdocs/admin/perms.php | 5 ++--- htdocs/api/admin/explorer.php | 1 + htdocs/api/admin/index.php | 1 + htdocs/asset/admin/assets_extrafields.php | 1 + htdocs/asset/admin/assets_type_extrafields.php | 4 ++-- htdocs/asset/admin/setup.php | 2 +- htdocs/asset/card.php | 2 +- htdocs/asset/document.php | 2 +- htdocs/asset/info.php | 1 + htdocs/asset/list.php | 2 +- htdocs/asset/note.php | 2 +- htdocs/asset/type.php | 1 + htdocs/commande/customer.php | 2 +- htdocs/commande/orderstoinvoice.php | 2 +- htdocs/resource/card.php | 7 ++----- htdocs/resource/contact.php | 5 ++--- htdocs/resource/document.php | 5 ++--- htdocs/resource/element_resource.php | 6 ++---- htdocs/resource/list.php | 2 +- htdocs/resource/note.php | 4 ++-- htdocs/website/websiteaccount_card.php | 2 +- 89 files changed, 143 insertions(+), 184 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 73d6be66ed7..2afd97f40c5 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $action=GETPOST('action','aZ09'); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminaccoutant'; // To manage different context of search -$langs->load("admin"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'companies')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 748fc7a0309..6fedfa6d2cb 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -31,9 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("agenda"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'agenda')); $action = GETPOST('action','alpha'); $cancel = GETPOST('cancel','alpha'); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 4c61500494d..fadb144b883 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("agenda"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'agenda')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index f40ab648e42..906ecd8d092 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (!$user->admin) accessforbidden(); -$langs->load("agenda"); -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array('agenda', 'admin', 'other')); $def = array(); $actiontest=GETPOST('test','alpha'); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index b6b332a4b99..2d20d285720 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("agenda"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'agenda')); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 76b69073f25..e78a8e089ed 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; if (!$user->admin) accessforbidden(); +// Load translation files required by the page $langs->loadLangs(array("admin","other","agenda")); $action = GETPOST('action','alpha'); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index ab0effc2c45..481a850790e 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; if (!$user->admin) accessforbidden(); +// Load translation files required by the page $langs->loadLangs(array("admin","other","agenda")); $def = array(); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index dcecd0c78c1..a4e9e4bb210 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin","companies","bills","other","banks")); if (!$user->admin) diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index aba65f63887..19446092923 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -30,8 +30,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("banks"); -$langs->load("admin"); +// Load translation files required by the page +$langs->loadLangs(array('banks', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index db2b85fa986..7c6792e1a02 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -28,6 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; +// Load translation files required by the page $langs->load("admin"); if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index bc1dc74f6c4..04fd76e96fc 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -28,8 +28,8 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("admin"); -$langs->load("boxes"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'boxes')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 0d2363f60c8..df628ecc87f 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin","companies","bills","other","banks")); if (!$user->admin) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 582131b22f3..c2cfaf9f72a 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -26,6 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +// Load translation files required by the page $langs->load("admin"); if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index cd4f4ca4ab2..cee12e4b08e 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -36,10 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -$langs->load("admin"); -$langs->load("errors"); -$langs->load("orders"); -$langs->load('other'); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'errors', 'orders', 'other')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index ab5e3f103fd..334a01c865a 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -40,8 +40,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $action=GETPOST('action','aZ09'); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search -$langs->load("admin"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'companies')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 3f765d3e18c..8e17541bfef 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -29,9 +29,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load('admin'); -$langs->load('compta'); -$langs->load('accountancy'); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'compta', 'accountancy')); if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index cd771cdb0f7..e4691a42e78 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -29,9 +29,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; -$langs->load("admin"); -$langs->load("sendings"); -$langs->load("deliveries"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'sendings', 'deliveries')); if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 7d7b8a8510c..afb2d31efce 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -27,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +// Load translation files required by the page $langs->load("admin"); if (! $user->admin) diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 82fa51e5ca8..74f7acb04f3 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin","errors","contracts")); if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 091c9ff66bf..4f3d45294a9 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php'; +// Load translation files required by the page $langs->loadLangs(array("admin","other","agenda")); if (!$user->admin) diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 5c17fd32eb0..0633ee90965 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -26,12 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; -$langs->load("companies"); -$langs->load("products"); -$langs->load("admin"); -$langs->load("sms"); -$langs->load("other"); -$langs->load("errors"); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'products', 'admin', 'sms', 'other', 'errors')); if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 4cf423b317f..ae3c43c5b24 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -27,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +// Load translation files required by the page $langs->load("admin"); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 74e4dd6bd4e..65ceb912ea9 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; +// Load translation files required by the page $langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions")); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index cf1992dce5f..dc2f3e489f7 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +// Load translation files required by the page $langs->load("admin"); if (! $user->admin) accessforbidden(); @@ -109,4 +110,4 @@ print ''; print ''; llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 6f4dce93e8c..1d1ec548853 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; if (!$user->admin) accessforbidden(); -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("users","admin","other")); $action=GETPOST('action','aZ09'); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 311398a78e1..eb18f904229 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (! $user->admin) diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index a12ed1f9b34..af49e5bf064 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -35,10 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("sendings"); -$langs->load("deliveries"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'sendings', 'deliveries')); $extrafields = new ExtraFields($db); diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 073451eba6e..5567e9480e8 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -37,9 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("sendings"); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'other', 'sendings')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 6d164b25282..1002b146113 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -34,10 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; -$langs->load("admin"); -$langs->load("errors"); -$langs->load("trips"); -$langs->load('other'); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'errors', 'trips', 'other')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index a83c9b04194..8db81edb869 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -33,10 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("errors"); -$langs->load("trips"); -$langs->load('other'); +// Load translation files required by the page +$langs->loadLangs(array('admin', 'errors', 'trips', 'other')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index bb68ea2182e..db7100d5928 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin","trips","errors","other","dict")); if (!$user->admin) accessforbidden(); @@ -181,4 +181,4 @@ echo ''; dol_fiche_end(); llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index ef915e196a2..b1d65b8635b 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php'; -// Load traductions files requiredby by page +// Load translation files required by the page $langs->loadLangs(array("admin","other","trips","errors","dict")); if (!$user->admin) accessforbidden(); @@ -356,4 +356,4 @@ echo '