From 49de7a58812882fe326f56345e277490c3a75b18 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Mon, 1 Oct 2018 09:22:23 +0300 Subject: [PATCH 01/11] Replace multiple load calls with loadLangs method --- dev/initdata/purge-data.php | 3 +-- htdocs/comm/propal/stats/index.php | 4 +--- htdocs/fourn/facture/contact.php | 4 +--- htdocs/fourn/facture/document.php | 4 +--- htdocs/fourn/facture/impayees.php | 4 +--- htdocs/fourn/facture/info.php | 3 +-- htdocs/fourn/facture/note.php | 3 +-- htdocs/fourn/facture/paiement.php | 5 +---- htdocs/fourn/index.php | 4 +--- htdocs/fourn/paiement/card.php | 5 +---- htdocs/fourn/paiement/info.php | 4 +--- htdocs/ftp/admin/ftpclient.php | 3 +-- htdocs/install/fileconf.php | 3 +-- htdocs/install/step1.php | 4 +--- htdocs/install/step2.php | 3 +-- htdocs/install/step4.php | 3 +-- htdocs/install/step5.php | 3 +-- htdocs/install/upgrade.php | 5 +---- htdocs/install/upgrade2.php | 5 +---- htdocs/margin/admin/margin.php | 5 +---- htdocs/margin/tabs/productMargins.php | 5 +---- htdocs/margin/tabs/thirdpartyMargins.php | 5 +---- htdocs/projet/admin/project_extrafields.php | 3 +-- htdocs/projet/element.php | 7 ++----- htdocs/public/cron/cron_run_jobs.php | 3 +-- htdocs/public/demo/index.php | 4 +--- htdocs/public/emailing/mailing-unsubscribe.php | 3 +-- htdocs/public/members/public_card.php | 5 +---- htdocs/public/members/public_list.php | 5 +---- htdocs/public/onlinesign/newonlinesign.php | 8 +------- htdocs/public/paybox/paymentko.php | 10 +--------- htdocs/public/paybox/paymentok.php | 9 +-------- htdocs/public/payment/paymentko.php | 9 +-------- htdocs/public/paypal/paymentko.php | 9 +-------- htdocs/public/stripe/paymentko.php | 9 +-------- htdocs/public/stripe/paymentok.php | 8 +------- htdocs/societe/admin/contact_extrafields.php | 3 +-- htdocs/societe/admin/societe.php | 3 +-- htdocs/societe/admin/societe_extrafields.php | 4 +--- htdocs/societe/document.php | 4 +--- htdocs/societe/notify/card.php | 5 +---- htdocs/societe/notify/index.php | 3 +-- htdocs/societe/price.php | 4 +--- htdocs/societe/project.php | 3 +-- htdocs/societe/societecontact.php | 3 +-- htdocs/support/index.php | 4 +--- htdocs/support/online.php | 4 +--- htdocs/takepos/admin/orderprinters.php | 5 +---- htdocs/takepos/admin/setup.php | 4 +--- htdocs/takepos/freezone.php | 3 +-- htdocs/takepos/invoice.php | 3 +-- htdocs/takepos/pay.php | 4 +--- htdocs/takepos/receipt.php | 4 +--- htdocs/variants/combinations.php | 3 +-- htdocs/variants/generator.php | 3 +-- scripts/accountancy/export-thirdpartyaccount.php | 5 +---- .../contracts/email_expire_services_to_customers.php | 4 +--- .../email_expire_services_to_representatives.php | 4 +--- scripts/members/sync_members_ldap2dolibarr.php | 4 +--- scripts/members/sync_members_types_ldap2dolibarr.php | 4 +--- scripts/user/sync_groups_ldap2dolibarr.php | 4 +--- scripts/user/sync_users_ldap2dolibarr.php | 4 +--- 62 files changed, 63 insertions(+), 214 deletions(-) diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 5a1e7b3afc3..2bdf200225b 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -44,8 +44,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -$langs->load("main"); -$langs->load("errors"); +$langs->loadLangs(array("main", "errors")); // Global variables $version=DOL_VERSION; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 00db6264377..b7f6bd68493 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -65,9 +65,7 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_p $form=new Form($db); $formpropal=new FormPropal($db); -$langs->load('propal'); -$langs->load('other'); -$langs->load("companies"); +$langs->loadLangs(array('propal', 'other', 'companies')); if ($mode == 'customer') { diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 923a9af03da..cb17be828ca 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -34,9 +34,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("bills"); -$langs->load('other'); -$langs->load("companies"); +$langs->loadLangs(array("bills", "other", "companies")); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('facid','int')); $ref = GETPOST('ref','alpha'); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 064ffd37b00..4239331d0a6 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -38,9 +38,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('bills'); -$langs->load('other'); -$langs->load("companies"); +$langs->loadLangs(array('bills', 'other', 'companies')); $id = GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'); $action=GETPOST('action','alpha'); diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index c1c4be9fb76..2e14a5187e4 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -33,9 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; if (! $user->rights->fournisseur->facture->lire) accessforbidden(); -$langs->load("companies"); -$langs->load("bills"); - +$langs->loadLangs(array("companies", "bills")); $socid=GETPOST('socid','int'); $option = GETPOST('option'); diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 0ba10aa1985..d0ca8cbc3da 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -34,8 +34,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('companies'); -$langs->load('bills'); +$langs->loadLangs(array("companies", "bills")); $id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int'); $ref = GETPOST("ref",'alpha'); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 3ed5d66829a..109ff71980c 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -33,8 +33,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load('bills'); -$langs->load("companies"); +$langs->loadLangs(array("bills", "companies")); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('facid','int')); $ref = GETPOST('ref','alpha'); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 0bcd9fd79ab..e7d88612813 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -38,10 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -$langs->load('companies'); -$langs->load('bills'); -$langs->load('banks'); -$langs->load('compta'); +$langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); // Security check $action = GETPOST('action','alpha'); diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 0a3ceec93a1..7228b68f1cd 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -$langs->load("suppliers"); -$langs->load("orders"); -$langs->load("companies"); +$langs->loadLangs(array("suppliers", "orders", "companies")); // Security check $socid = GETPOST("socid", 'int'); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 0392bf3b8bd..22b3e307ab3 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -32,10 +32,7 @@ require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -$langs->load('bills'); -$langs->load('banks'); -$langs->load('companies'); -$langs->load("suppliers"); +$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers')); $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php index 83794c8fb58..1c670c1396a 100644 --- a/htdocs/fourn/paiement/info.php +++ b/htdocs/fourn/paiement/info.php @@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -$langs->load("bills"); -$langs->load("suppliers"); -$langs->load("companies"); +$langs->loadLangs(array("bills", "suppliers", "companies")); $id = GETPOST('id','int'); diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 1e9a6227825..07f2847eda2 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -25,8 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("admin"); -$langs->load("ftp"); +$langs->loadLangs(array("admin", "ftp")); // Security check if (!$user->admin) accessforbidden(); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index d0fd9b7ecf8..fd902b540fd 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -36,8 +36,7 @@ $err=0; $setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):(isset($_GET["lang"])?$_GET["lang"]:'auto'); $langs->setDefaultLang($setuplang); -$langs->load("install"); -$langs->load("errors"); +$langs->loadLangs(array("install", "errors")); dolibarr_install_syslog("- fileconf: entering fileconf.php page"); diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 374dcf585f2..34bd117504a 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -36,9 +36,7 @@ $action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):(empty($argv[1])?'':$a $setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[2])?'auto':$argv[2]); $langs->setDefaultLang($setuplang); -$langs->load("admin"); -$langs->load("install"); -$langs->load("errors"); +$langs->loadLangs(array("admin", "install", "errors")); // Dolibarr pages directory $main_dir = GETPOST('main_dir')?GETPOST('main_dir'):(empty($argv[3])?'':$argv[3]); diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index b9adb5dac21..52403c756c1 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -46,8 +46,7 @@ $action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):(empty($argv[1])?'':$a $setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[2])?'auto':$argv[2]); $langs->setDefaultLang($setuplang); -$langs->load("admin"); -$langs->load("install"); +$langs->loadLangs(array("admin", "install")); $choix=0; if ($dolibarr_main_db_type == "mysqli") $choix=1; diff --git a/htdocs/install/step4.php b/htdocs/install/step4.php index 64d6993cc94..e35aa0720c3 100644 --- a/htdocs/install/step4.php +++ b/htdocs/install/step4.php @@ -35,8 +35,7 @@ global $langs; $setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[1])?'auto':$argv[1]); $langs->setDefaultLang($setuplang); -$langs->load("admin"); -$langs->load("install"); +$langs->loadLangs(array("admin", "install")); // Now we load forced value from install.forced.php file. $useforcedwizard=false; diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 845c3aa8a02..b2d3083a624 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -52,8 +52,7 @@ if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upg } } -$langs->load("admin"); -$langs->load("install"); +$langs->loadLangs(array("admin", "install")); $login = GETPOST('login', 'alpha')?GETPOST('login', 'alpha'):(empty($argv[5])?'':$argv[5]); $pass = GETPOST('pass', 'alpha')?GETPOST('pass', 'alpha'):(empty($argv[6])?'':$argv[6]); diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 6838f5c6e19..5f372f521f8 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -66,10 +66,7 @@ $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'',3):(empty($argv $dirmodule=((GETPOST("dirmodule",'alpha',3) && GETPOST("dirmodule",'alpha',3) != 'ignoredbversion'))?GETPOST("dirmodule",'alpha',3):((empty($argv[3]) || $argv[3] == 'ignoredbversion')?'':$argv[3]); $ignoredbversion=(GETPOST('ignoredbversion','alpha',3)=='ignoredbversion')?GETPOST('ignoredbversion','alpha',3):((empty($argv[3]) || $argv[3] != 'ignoredbversion')?'':$argv[3]); -$langs->load("admin"); -$langs->load("install"); -$langs->load("other"); -$langs->load("errors"); +$langs->loadLangs(array("admin", "install", "other", "errors")); if ($dolibarr_main_db_type == "mysqli") $choix=1; if ($dolibarr_main_db_type == "pgsql") $choix=2; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index bd28a949f6b..f4f7413b7d4 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -73,10 +73,7 @@ $versionfrom=GETPOST("versionfrom",'alpha',3)?GETPOST("versionfrom",'alpha',3):( $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'alpha',3):(empty($argv[2])?'':$argv[2]); $enablemodules=GETPOST("enablemodules",'alpha',3)?GETPOST("enablemodules",'alpha',3):(empty($argv[3])?'':$argv[3]); -$langs->load('admin'); -$langs->load('install'); -$langs->load("bills"); -$langs->load("suppliers"); +$langs->loadLangs(array("admin", "install", "bills", "suppliers")); if ($dolibarr_main_db_type == 'mysqli') $choix=1; if ($dolibarr_main_db_type == 'pgsql') $choix=2; diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 4ccdcc4542a..b2c74506990 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -29,10 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; -$langs->load("admin"); -$langs->load("bills"); -$langs->load("margins"); -$langs->load("stocks"); +$langs->loadLangs(array("admin", "bills", "margins", "stocks")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index b4c1ac0cdd0..b8360c7ca6c 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -26,10 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.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'); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 2ecd6088abf..8ce4b7a0c0b 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -26,10 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.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/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index 8f39a20f762..15ccd50bf76 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -30,8 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("project"); -$langs->load("admin"); +$langs->loadLangs(array("project", "admin")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3303d63ef81..1da887ea7a9 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -548,11 +548,8 @@ if (! $showdatefilter) // Show balance for whole project -$langs->load("suppliers"); -$langs->load("bills"); -$langs->load("orders"); -$langs->load("proposals"); -$langs->load("margins"); +$langs->loadLangs(array("suppliers", "bills", "orders", "proposals", "margins")); + if (!empty($conf->stock->enabled)) $langs->load('stocks'); print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy'); diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 49e1a2de561..320a8e3895a 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -44,8 +44,7 @@ dol_include_once("/cron/class/cronjob.class.php"); global $langs, $conf; // Language Management -$langs->load("admin"); -$langs->load("cron"); +$langs->loadLangs(array("admin", "cron")); /* * View diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 61919c54b1a..f9169bb47d2 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -30,9 +30,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require '../../main.inc.php'; require_once '../../core/lib/functions2.lib.php'; -$langs->load("main"); -$langs->load("install"); -$langs->load("other"); +$langs->loadLangs(array("main", "install", "other")); $conf->dol_hide_topmenu=GETPOST('dol_hide_topmenu','int'); $conf->dol_hide_leftmenu=GETPOST('dol_hide_leftmenu','int'); diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 1dc1477e7b4..c27cb024aab 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -53,8 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; global $user, $conf, $langs; -$langs->load("main"); -$langs->load("mails"); +$langs->loadLangs(array("main", "mails")); $tag=GETPOST('tag'); $unsuscrib=GETPOST('unsuscrib'); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 5dee0eb49a3..eda1aaf2c68 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -43,10 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("members"); -$langs->load("companies"); -$langs->load("other"); +$langs->loadLangs(array("main", "members", "companies", "other")); $id=GETPOST('id','int'); $object = new Adherent($db); diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 1f9a4406028..6ba46182427 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -40,10 +40,7 @@ require '../../main.inc.php'; if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("members"); -$langs->load("companies"); -$langs->load("other"); +$langs->loadLangs(array("main", "members", "companies", "other")); /** diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 43508cfe177..e8db916ad91 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -44,13 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; // Security check // No check on module enabled. Done later according to $validpaymentmethod -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("errors"); -$langs->load("paybox"); // File with generic data +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); $action=GETPOST('action','alpha'); diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index feb4070c16b..ef642a5b80b 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -39,15 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paybox->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); - +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); $object = new stdClass(); // For triggers diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 9e711ade51b..41eef8784bc 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -39,14 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paybox->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); /*$source=GETPOST('source'); $ref=GETPOST('ref'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 01bee23d124..33fc1fb5101 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -44,14 +44,7 @@ if (! empty($conf->paypal->enabled)) require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); if (! empty($conf->paypal->enabled)) { diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index 3e555379849..03645244e91 100644 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -43,14 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paypal->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); $PAYPALTOKEN=GETPOST('TOKEN'); if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); diff --git a/htdocs/public/stripe/paymentko.php b/htdocs/public/stripe/paymentko.php index ff1abfae9e4..be285cfc628 100644 --- a/htdocs/public/stripe/paymentko.php +++ b/htdocs/public/stripe/paymentko.php @@ -36,14 +36,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); diff --git a/htdocs/public/stripe/paymentok.php b/htdocs/public/stripe/paymentok.php index 52b3dac8a7f..4bce7dd62ce 100644 --- a/htdocs/public/stripe/paymentok.php +++ b/htdocs/public/stripe/paymentok.php @@ -36,13 +36,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal")); $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index 34bdb688835..5eaba3c1cb1 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -28,8 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); +$langs->loadLangs(array("companies", "admin")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index f07922b1781..3a7b26505c7 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -29,8 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -$langs->load("admin"); -$langs->load('other'); +$langs->loadLangs(array("admin", "other")); $action=GETPOST('action','alpha'); $value=GETPOST('value','alpha'); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 39f3ab53866..0835df13e22 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -28,9 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("members"); +$langs->loadLangs(array("companies", "admin", "members")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 25478e133af..a9aae7a8654 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.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/class/html.formfile.class.php'; -$langs->load("companies"); -$langs->load('other'); - +$langs->loadLangs(array("companies", "other")); $action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm'); diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index fb4b51f17c8..b5de5c77456 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -30,10 +30,7 @@ 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/triggers/interface_50_modNotification_Notification.class.php'; -$langs->load("companies"); -$langs->load("mails"); -$langs->load("admin"); -$langs->load("other"); +$langs->loadLangs(array("companies", "mails", "admin", "other")); $socid = GETPOST("socid",'int'); $action = GETPOST('action','aZ09'); diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index 9980cf19a2a..129131ff5c6 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -23,8 +23,7 @@ */ require '../../main.inc.php'; -$langs->load("companies"); -$langs->load("banks"); +$langs->loadLangs(array("companies", "banks")); // S�curit� acc�s client if ($user->societe_id > 0) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 45d7f9ad020..0fbc4368a87 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -38,9 +38,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($db); } -$langs->load("products"); -$langs->load("companies"); -$langs->load("bills"); +$langs->loadLangs(array("products", "companies", "bills")); $action = GETPOST('action', 'alpha'); $search_prod = GETPOST('search_prod','alpha'); diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index dd06346ca33..f92d274fe46 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -31,8 +31,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load("companies"); -$langs->load("projects"); +$langs->loadLangs(array("companies", "projects")); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index a2f09f9b77d..edfa2f28d5c 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -$langs->load("orders"); -$langs->load("companies"); +$langs->loadLangs(array("orders", "companies")); $id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); $ref=GETPOST('ref','alpha'); diff --git a/htdocs/support/index.php b/htdocs/support/index.php index ab5d62df39e..bc0ef1a79c5 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -34,9 +34,7 @@ if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' if (! defined('DOL_URL_ROOT')) define('DOL_URL_ROOT', $pos); // URL racine relative -$langs->load("other"); -$langs->load("help"); - +$langs->loadLangs(array("other", $langs->load("help"))); /* * View diff --git a/htdocs/support/online.php b/htdocs/support/online.php index 0f2dca142fc..01b2cb4dbd1 100644 --- a/htdocs/support/online.php +++ b/htdocs/support/online.php @@ -30,9 +30,7 @@ if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' define('DOL_URL_ROOT', $pos); // URL racine relative -$langs->load("other"); -$langs->load("help"); - +$langs->loadLangs(array("other", "help")); /* * View diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index 646eef127bf..4c72031b41b 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -32,10 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("main"); -$langs->load("categories"); -$langs->load("takepos"); -$langs->load("printing"); +$langs->loadLangs(array("main"), "categories", "takepos", "printing"); if (! $user->rights->categorie->lire) accessforbidden(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 702f9d8bc07..453ecf64609 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -37,9 +37,7 @@ if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) // Security check if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("cashdesk"); - +$langs->loadLangs(array("admin", "cashdesk")); /* * Actions diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index f97d46518e3..702c59541a3 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -27,8 +27,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); require '../main.inc.php'; // Load $user and permissions -$langs->load("bills"); -$langs->load("cashdesk"); +$langs->loadLangs(array("bills", "cashdesk")); $place = GETPOST('place','int'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 91b43dad675..f0e5d21770c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -29,8 +29,7 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -$langs->load("bills"); -$langs->load("cashdesk"); +$langs->loadLangs(array("bills", "cashdesk")); $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 5f3b27b95be..c0bfc35294a 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -49,9 +49,7 @@ else{ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +$langs->loadLangs(array("main", "bills", "cashdesk")); ?>