From 7fcbd0fe4242a71949f2c54af2cc94b3b43c4f13 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 9 Sep 2018 11:10:32 +0200 Subject: [PATCH] Standardize and update code --- htdocs/cashdesk/affIndex.php | 5 ++--- htdocs/cashdesk/index.php | 4 ++-- htdocs/cashdesk/index_verif.php | 11 +++++------ htdocs/cashdesk/tpl/facturation1.tpl.php | 6 ++---- htdocs/cashdesk/tpl/liste_articles.tpl.php | 5 ++--- htdocs/cashdesk/tpl/menu.tpl.php | 5 ++--- htdocs/cashdesk/tpl/ticket.tpl.php | 4 ++-- htdocs/cashdesk/tpl/validation1.tpl.php | 6 ++---- htdocs/cashdesk/tpl/validation2.tpl.php | 5 ++--- htdocs/collab/index.php | 5 ++--- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 11 files changed, 25 insertions(+), 35 deletions(-) diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index a2e467a35e3..9ff676531f1 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -36,9 +36,8 @@ if ( $_SESSION['uid'] <= 0 ) exit; } -$langs->load("companies"); -$langs->load("compta"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("companies","compta","cashdesk")); /* diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 24b94562915..9e6ceb84de3 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -28,8 +28,8 @@ require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; -$langs->load("admin"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("admin","cashdesk")); // Test if user logged if ( $_SESSION['uid'] > 0 ) diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 238a73f6ef7..cd354293022 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -30,9 +30,8 @@ include '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; -$langs->load("main"); -$langs->load("admin"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","admin","cashdesk")); $username = GETPOST("txtUsername"); $password = GETPOST("pwdPassword"); @@ -119,7 +118,7 @@ if ( $retour >= 0 ) $_SESSION['firstname'] = $tab['firstname']; $_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : ''); $_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : ''); - + $_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : ''); @@ -135,8 +134,8 @@ if ( $retour >= 0 ) } else { - $langs->load("errors"); - $langs->load("other"); + // Load translation files required by the page + $langs->loadLangs(array("other","errors")); $retour=$langs->trans("ErrorBadLoginPassword"); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 146ae3d40b6..880eb77b8af 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -26,10 +26,8 @@ if (empty($langs) || ! is_object($langs)) exit; } - -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","bills","cashdesk")); // Object $form must de defined diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 65f48b0603c..266c5e5840b 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -28,9 +28,8 @@ if (empty($langs) || ! is_object($langs)) require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","bills","cashdesk")); ?> diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 250aaa18cc2..afe2c0da4ec 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -63,9 +63,8 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) $warehouseLink = $warehouse->getNomUrl(1); } - -$langs->load("cashdesk"); -$langs->load("main"); +// Load translation files required by the page +$langs->loadLangs(array("main","cashdesk")); print "\n".''."\n"; print '