Standardize and update code

This commit is contained in:
Philippe GRAND 2018-09-14 10:20:21 +02:00
parent 961505d510
commit 18f4755a90
4 changed files with 9 additions and 9 deletions

View File

@ -727,8 +727,8 @@ class FormTicket
{ {
global $conf, $langs, $user, $mysoc; global $conf, $langs, $user, $mysoc;
$langs->load("other"); // Load translation files required by the page
$langs->load("mails"); $langs->loadLangs(array('other', 'mails'));
$addfileaction = 'addfile'; $addfileaction = 'addfile';

View File

@ -1141,8 +1141,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
global $db, $conf, $user, $langs; global $db, $conf, $user, $langs;
global $hookmanager; global $hookmanager;
$langs->load("other"); // Load translation files required by the page
$langs->load("errors"); $langs->loadLangs(array('other', 'errors'));
dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook); dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook);

View File

@ -3865,8 +3865,8 @@ function dol_print_error($db='',$error='',$errors=null)
$langs = new Translate('', $conf); $langs = new Translate('', $conf);
$langs->load("main"); $langs->load("main");
} }
$langs->load("main"); // Load translation files required by the page
$langs->load("errors"); $langs->loadLangs(array('main', 'errors'));
if ($_SERVER['DOCUMENT_ROOT']) // Mode web if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{ {

View File

@ -105,9 +105,9 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod
{ {
dol_syslog("Authentification ko - failed to load file '".$authfile."'", LOG_ERR); dol_syslog("Authentification ko - failed to load file '".$authfile."'", LOG_ERR);
sleep(1); sleep(1);
$langs->load('main'); // Load translation files required by the page
$langs->load('other'); $langs->loadLangs(array('other', 'main', 'errors'));
$langs->load('errors');
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorFailedToLoadLoginFileForMode", $mode); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorFailedToLoadLoginFileForMode", $mode);
} }
} }