[Qual] Uniformize code
This commit is contained in:
parent
4e937a0252
commit
aa6b5bc1ce
@ -117,7 +117,7 @@ $head = ldap_prepare_head();
|
||||
// Test si fonction LDAP actives
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
|
||||
|
||||
@ -213,7 +213,7 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result,'errors');
|
||||
setEventMessages($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, null, 'errors');
|
||||
}
|
||||
|
||||
$action='';
|
||||
|
||||
@ -66,7 +66,7 @@ $familyinfo=array(
|
||||
if ($action == 'set' && $user->admin)
|
||||
{
|
||||
$result=activateModule($value);
|
||||
if ($result) setEventMessage($result, 'errors');
|
||||
if ($result) setEventMessages($result, null, 'errors');
|
||||
header("Location: modules.php?mode=".$mode);
|
||||
exit;
|
||||
}
|
||||
@ -74,7 +74,7 @@ if ($action == 'set' && $user->admin)
|
||||
if ($action == 'reset' && $user->admin)
|
||||
{
|
||||
$result=unActivateModule($value);
|
||||
if ($result) setEventMessage($result, 'errors');
|
||||
if ($result) setEventMessages($result, null, 'errors');
|
||||
header("Location: modules.php?mode=".$mode);
|
||||
exit;
|
||||
}
|
||||
@ -125,7 +125,7 @@ foreach ($modulesdir as $dir)
|
||||
if (! empty($modNameLoaded[$modName]))
|
||||
{
|
||||
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
||||
setEventMessage($mesg, 'warnings');
|
||||
setEventMessages($mesg, null, 'warnings');
|
||||
dol_syslog($mesg, LOG_ERR);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -93,13 +93,13 @@ if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,11 +54,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -81,12 +81,12 @@ if ($action == "set")
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -59,11 +59,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,13 +101,13 @@ if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($module->error,'errors');
|
||||
setEventMessages($module->error, $module->errors, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@ -121,11 +121,11 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,11 +139,11 @@ if ($action == 'set_PROPOSAL_FREE_TEXT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,11 +155,11 @@ if ($action == 'setdefaultduration')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,11 +171,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,12 +199,12 @@ if ($action == 'setModuleOptions')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,12 +44,12 @@ if (GETPOST("action") == 'set_proxy')
|
||||
{
|
||||
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
|
||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
|
||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ if (GETPOST("action") == 'set_proxy')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,11 +60,11 @@ if ($action == 'update')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ if ($action == 'activate_encryptdbpassconf')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)),'warnings');
|
||||
setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
|
||||
}
|
||||
}
|
||||
else if ($action == 'disable_encryptdbpassconf')
|
||||
@ -152,7 +152,7 @@ else if ($action == 'disable_encryptdbpassconf')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass),'warnings');
|
||||
setEventMessages($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ else if ($action == 'updateform')
|
||||
$res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity);
|
||||
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity);
|
||||
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity);
|
||||
if ($res3 && $res4 && $res5 && $res6) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
|
||||
|
||||
@ -97,8 +97,8 @@ else if ($action == 'delete')
|
||||
$langs->load("other");
|
||||
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
Header('Location: '.$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ else if ($action == 'updateform')
|
||||
{
|
||||
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
|
||||
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
|
||||
if ($res1 && $res2) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
if ($res1 && $res2) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ if ($action == 'send' && ! $_POST['cancel'])
|
||||
|
||||
if (! empty($formsms->error))
|
||||
{
|
||||
setEventMessage($formsms->error,'errors');
|
||||
setEventMessages($formsms->error, $formsms->errors, 'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
@ -123,11 +123,11 @@ if ($action == 'send' && ! $_POST['cancel'])
|
||||
|
||||
if ($result)
|
||||
{
|
||||
setEventMessage($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto));
|
||||
setEventMessages($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ResultKo"),'errors');
|
||||
setEventMessages($langs->trans("ResultKo"), null, 'errors');
|
||||
}
|
||||
|
||||
$action='';
|
||||
|
||||
@ -71,11 +71,11 @@ if ($action == 'update' || $action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,12 +96,12 @@ if($action)
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -63,11 +63,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,13 +106,13 @@ if ($action == 'specimen') // For invoices
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($module->error,'errors');
|
||||
setEventMessages($module->error, $module->errors, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@ -174,11 +174,11 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -64,11 +64,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,13 +107,13 @@ else if ($action == 'specimen') // For orders
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($module->error,'errors');
|
||||
setEventMessages($module->error, $module->errors, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,12 +119,12 @@ if ($action == 'set')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($error, 'errors');
|
||||
setEventMessages($error, $errors, 'errors');
|
||||
|
||||
}
|
||||
|
||||
@ -140,11 +140,11 @@ if ($action == 'setlevel')
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -98,10 +98,10 @@ if ($action == 'update') {
|
||||
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user