';
diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index ca651854a24..b02fa90baa9 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -75,12 +75,12 @@ if ($action == 'dolibarr2ldap')
if ($result >= 0)
{
- $message.=''.$langs->trans("MemberSynchronized").'
';
+ setEventMessage($langs->trans("MemberSynchronized"));
$db->commit();
}
else
{
- $message.=''.$ldap->error.'
';
+ setEventMessage($ldap->error, 'errors');
$db->rollback();
}
}
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index 1944521a581..f23e80f78ff 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -105,7 +105,6 @@ if ($action == 'add' || GETPOST("modify"))
if ($result1 && $result2)
{
$db->commit();
- //$mesg=''.$langs->trans("Success").'
';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@@ -171,7 +170,6 @@ if ($_POST["delete"])
if ($result1 && $result2)
{
$db->commit();
- //$mesg=''.$langs->trans("Success").'
';
header("Location: external_rss.php");
exit;
}
diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php
index d99a02308b7..42d1ed5c9ca 100644
--- a/htdocs/admin/menus/edit.php
+++ b/htdocs/admin/menus/edit.php
@@ -39,7 +39,6 @@ $dirsmartphone = "/core/menus/smartphone";
$dirmenu = array($dirstandard,$dirsmartphone);
$action=GETPOST('action');
-$mesg=GETPOST('mesg');
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
@@ -79,16 +78,16 @@ if ($action == 'update')
$result=$menu->update($user);
if ($result > 0)
{
- $mesg=''.$langs->trans("RecordModifiedSuccessfully").'
';
+ setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else
{
- $mesg=''.$menu->error.'
';
+ setEventMessage($menu->error, 'errors');
}
}
else
{
- $mesg=''.$menu->error.'
';
+ setEventMessage($menu->error, 'errors');
}
$_GET["menuId"] = $_POST['menuId'];
$action = "edit";
@@ -136,37 +135,37 @@ if ($action == 'add')
$error=0;
if (! $error && ! $_POST['menu_handler'])
{
- $mesg=''.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")).'
';
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")), 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['type'])
{
- $mesg=''.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")).'
';
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['url'])
{
- $mesg=''.$langs->trans("ErrorFieldRequired",$langs->trans("Url")).'
';
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['titre'])
{
- $mesg=''.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'
';
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors');
$action = 'create';
$error++;
}
if (! $error && $_POST['menuId'] && $_POST['type'] == 'top')
{
- $mesg=''.$langs->trans("ErrorTopMenuMustHaveAParentWithId0").'
';
+ setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors');
$action = 'create';
$error++;
}
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
{
- $mesg=''.$langs->trans("ErrorLeftMenuMustHaveAParentId").'
';
+ setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors');
$action = 'create';
$error++;
}
@@ -205,7 +204,7 @@ if ($action == 'add')
else
{
$action = 'create';
- $mesg=''.$menu->error.'
';
+ setEventMessage($menu->error, 'errors');
}
}
}
@@ -223,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
$this->db->commit();
llxHeader();
- print ''.$langs->trans("MenuDeleted").'
';
+ setEventMessage($langs->trans("MenuDeleted"));
llxFooter();
exit ;
}
@@ -375,8 +374,6 @@ if ($action == 'create')
print ' ';
print '';
-
- dol_htmloutput_mesg($mesg);
}
elseif ($action == 'edit')
{
@@ -463,8 +460,6 @@ elseif ($action == 'edit')
print '';
print ' ';
-
- dol_htmloutput_mesg($mesg);
}
diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php
index d58e7444e71..15d5b5f3d52 100644
--- a/htdocs/admin/tools/update.php
+++ b/htdocs/admin/tools/update.php
@@ -54,7 +54,7 @@ if (GETPOST('action','alpha')=='install')
if (! $original_file)
{
$langs->load("Error");
- $mesg = ''.$langs->trans("ErrorFileRequired").'
';
+ setEventMessage($langs->trans("ErrorFileRequired"), 'warnings');
$error++;
}
else
@@ -62,7 +62,7 @@ if (GETPOST('action','alpha')=='install')
if (! preg_match('/\.zip/i',$original_file))
{
$langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFileMustBeADolibarrPackage",$original_file).'
';
+ setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors');
$error++;
}
}
@@ -80,12 +80,11 @@ if (GETPOST('action','alpha')=='install')
if (! empty($result['error']))
{
$langs->load("errors");
- $mesg = ''.$langs->trans($result['error'],$original_file).'
';
-
+ setEventMessage($langs->trans($result['error'],$original_file), 'errors');
}
else
{
- $mesg = ''.$langs->trans("SetupIsReadyForUse").'
';
+ setEventMessage($langs->trans("SetupIsReadyForUse"));
}
}
}
@@ -107,9 +106,6 @@ print $langs->trans("CurrentVersion").' : '.DOL_VERSION.' ';
print $langs->trans("LastStableVersion").' : '.$langs->trans("FeatureNotYetAvailable").' ';
print ' ';
-//dol_htmloutput_errors($mesg);
-dol_htmloutput_mesg($mesg);
-
print $langs->trans("Upgrade").' ';
print ' ';
print $langs->trans("ThisIsProcessToFollow").' ';
diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php
index 60c587ac674..7bdc4680853 100644
--- a/htdocs/comm/mailing/fiche.php
+++ b/htdocs/comm/mailing/fiche.php
@@ -107,7 +107,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
{
- $mesg=''.$langs->trans("NoCloneOptionsSpecified").'
';
+ setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
else
{
@@ -119,7 +119,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
}
else
{
- $mesg=$object->error;
+ setEventMessage($object->error, 'errors');
}
}
$action='';
@@ -130,16 +130,17 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
{
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{
+ //TODO: What is this for?
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message
- $mesg=''.$langs->trans("MailingNeedCommand").'
';
- $mesg.=' ';
- $mesg.=''.$langs->trans("MailingNeedCommand2").'
';
+ setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
+ setEventMessage('', 'warnings');
+ setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
$action='';
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
- $mesg=''.$langs->trans("NotEnoughPermissions").'
';
+ setEventMessage($langs->trans("NotEnoughPermissions"), 'warnings');
$action='';
}
else
@@ -390,7 +391,7 @@ if ($action == 'send' && empty($_POST["cancel"]))
$object->sendto = $_POST["sendto"];
if (! $object->sendto)
{
- $mesg=''.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'
';
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("MailTo")), 'errors');
$error++;
}
@@ -430,11 +431,11 @@ if ($action == 'send' && empty($_POST["cancel"]))
$result=$mailfile->sendfile();
if ($result)
{
- $mesg=''.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)).'
';
+ setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)));
}
else
{
- $mesg=''.$langs->trans("ResultKo").' '.$mailfile->error.' '.$result.'
';
+ setEventMessage($langs->trans("ResultKo").' '.$mailfile->error.' '.$result, 'errors');
}
$action='';
@@ -467,7 +468,7 @@ if ($action == 'add')
$mesg=$object->error;
}
- $mesg=''.$mesg.'
';
+ setEventMessage($mesg, 'errors');
$action="create";
}
@@ -494,7 +495,7 @@ if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyt
$mesg=$object->error;
}
- $mesg=''.$mesg.'
';
+ setEventMessage($mesg, 'errors');
$action="";
}
@@ -552,7 +553,7 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
$mesg=$object->error;
}
- $mesg=''.$mesg.'
';
+ setEventMessage($mesg, 'errors');
$action="edit";
}
else
@@ -598,7 +599,7 @@ if ($action == 'confirm_reset' && $confirm == 'yes')
}
else
{
- $mesg=$object->error;
+ setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@@ -646,8 +647,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewMailing"));
- dol_htmloutput_mesg($mesg);
-
print '';
print ''.$langs->trans("MailTitle").' ';
print ''.$langs->trans("MailFrom").' ';
@@ -829,9 +828,6 @@ else
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240);
}
-
- dol_htmloutput_mesg($mesg);
-
/*
* Boutons d'action
*/
@@ -1017,8 +1013,6 @@ else
* Mailing en mode edition
*/
- dol_htmloutput_mesg($mesg);
-
print '';
// Ref
diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php
index 97f3fb9d47c..74ec9f4cb69 100644
--- a/htdocs/compta/paiement/fiche.php
+++ b/htdocs/compta/paiement/fiche.php
@@ -45,8 +45,6 @@ if ($user->societe_id) $socid=$user->societe_id;
// TODO ajouter regle pour restreindre acces paiement
//$result = restrictedArea($user, 'facture', $id,'');
-$mesg='';
-
$object = new Paiement($db);
@@ -67,7 +65,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
}
else
{
- $mesg=''.$object->error.'
';
+ setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@@ -87,7 +85,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
else
{
$langs->load("errors");
- $mesg=''.$langs->trans($object->error).'
';
+ setEventMessage($langs->trans($object->error), 'errors');
$db->rollback();
}
}
@@ -123,7 +121,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
else
{
$langs->load("errors");
- $mesg=''.$langs->trans($object->error).'
';
+ setEventMessage($langs->trans($object->error), 'errors');
$db->rollback();
}
}
@@ -134,11 +132,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']);
if ($res === 0)
{
- $mesg = ''.$langs->trans('PaymentNumberUpdateSucceeded').'
';
+ setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
}
else
{
- $mesg = ''.$langs->trans('PaymentNumberUpdateFailed').'
';
+ setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
}
}
@@ -149,11 +147,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
$res = $object->update_date($datepaye);
if ($res === 0)
{
- $mesg = ''.$langs->trans('PaymentDateUpdateSucceeded').'
';
+ setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
}
else
{
- $mesg = ''.$langs->trans('PaymentDateUpdateFailed').'
';
+ setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
}
}
@@ -198,10 +196,6 @@ if ($action == 'valide')
}
-
-dol_htmloutput_mesg($mesg);
-
-
print '';
// Ref
diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php
index 48a8f656959..1583c8ebc49 100644
--- a/htdocs/compta/sociales/charges.php
+++ b/htdocs/compta/sociales/charges.php
@@ -110,13 +110,9 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
$chargesociales->amount=$_POST["amount"];
$id=$chargesociales->create($user);
- if ($id > 0)
+ if ($id <= 0)
{
- //$mesg=''.$langs->trans("SocialContributionAdded").'
';
- }
- else
- {
- $mesg=''.$chargesociales->error.'
';
+ setEventMessage($chargesociales->error, 'errors');
}
}
}
@@ -146,13 +142,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
$chargesociales->periode=$dateperiod;
$result=$chargesociales->update($user);
- if ($result > 0)
+ if ($result <= 0)
{
- //$mesg=''.$langs->trans("SocialContributionAdded").'
';
- }
- else
- {
- $mesg=''.$chargesociales->error.'
';
+ setEventMessage($chargesociales->error, 'errors');
}
}
}
diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php
index 1681324323a..fe3098eaa9a 100644
--- a/htdocs/contact/ldap.php
+++ b/htdocs/contact/ldap.php
@@ -49,8 +49,6 @@ $contact->fetch($id, $user);
if ($action == 'dolibarr2ldap')
{
- $message="";
-
$db->begin();
$ldap=new Ldap();
@@ -64,12 +62,12 @@ if ($action == 'dolibarr2ldap')
if ($result >= 0)
{
- $message.=''.$langs->trans("ContactSynchronized").'
';
+ setEventMessage($langs->trans("ContactSynchronized"));
$db->commit();
}
else
{
- $message.=''.$ldap->error.'
';
+ setEventMessage($ldap->error, 'errors');
$db->rollback();
}
}
@@ -136,10 +134,6 @@ print '
';
print '';
-
-dol_htmloutput_mesg($message);
-
-
/*
* Barre d'actions
*/
diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php
index 3ed72bd2034..777621fa432 100644
--- a/htdocs/core/modules/mailings/xinputfile.modules.php
+++ b/htdocs/core/modules/mailings/xinputfile.modules.php
@@ -137,8 +137,6 @@ class mailing_xinputfile extends MailingTargets
{
$cpt=0;
- //$mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
$file=$upload_dir . "/" . $_FILES['username']['name'];
$handle = @fopen($file, "r");
if ($handle)
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index e46011c45ba..8f9bd5573bf 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -110,8 +110,6 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
- //$mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else
@@ -134,7 +132,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
else
{
$langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFailToCreateDir",$upload_dir).'
';
+ setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
}
}
}
@@ -156,7 +154,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
}
else
{
- $mesg='Error '.$langs->trans($ecmdir->error).'
';
+ setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
$action = "create";
}
@@ -198,7 +196,7 @@ if ($action == 'confirm_deletefile')
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
{
$result=$ecmdir->delete($user);
- $mesg = ''.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'
';
+ setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
clearstatcache();
}
@@ -324,7 +322,6 @@ if ($action == 'refreshmanual')
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
if (! dol_is_dir($dirtotest))
{
- $mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']." \n";
$ecmdirtmp->id=$dirdesc['id'];
$ecmdirtmp->delete($user,'databaseonly');
//exit;
@@ -440,9 +437,6 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax))
}
-dol_htmloutput_mesg($mesg);
-
-
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
else $classviewhide='visible';
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 9c4ab7e0e2f..3e6e6cfa05b 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -110,8 +110,6 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
- //$mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else
@@ -134,7 +132,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
else
{
$langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFailToCreateDir",$upload_dir).'
';
+ setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
}
}
}
@@ -156,7 +154,8 @@ if ($action == 'add' && $user->rights->ecm->setup)
}
else
{
- $mesg='Error '.$langs->trans($ecmdir->error).'
';
+ //TODO: Translate
+ setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
$action = "create";
}
@@ -198,7 +197,7 @@ if ($action == 'confirm_deletefile')
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
{
$result=$ecmdir->delete($user);
- $mesg = ''.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'
';
+ setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
clearstatcache();
}
@@ -324,7 +323,6 @@ if ($action == 'refreshmanual')
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
if (! dol_is_dir($dirtotest))
{
- $mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']." \n";
$ecmdirtmp->id=$dirdesc['id'];
$ecmdirtmp->delete($user,'databaseonly');
//exit;
@@ -436,9 +434,6 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax))
}
-dol_htmloutput_mesg($mesg);
-
-
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
else $classviewhide='visible';
diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php
index 9a38e16f7f4..32edf72a2ad 100644
--- a/htdocs/fourn/paiement/fiche.php
+++ b/htdocs/fourn/paiement/fiche.php
@@ -36,8 +36,6 @@ $langs->load('banks');
$langs->load('companies');
$langs->load("suppliers");
-$mesg='';
-
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
@@ -61,7 +59,7 @@ if ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
}
else
{
- $mesg=''.$object->error.'
';
+ setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@@ -80,7 +78,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
}
else
{
- $mesg=''.$object->error.'
';
+ setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@@ -98,7 +96,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisse
}
else
{
- $mesg=''.$object->error.'
';
+ setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@@ -109,11 +107,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']);
if ($res === 0)
{
- $mesg = ''.$langs->trans('PaymentNumberUpdateSucceeded').'
';
+ $setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
}
else
{
- $mesg = ''.$langs->trans('PaymentNumberUpdateFailed').'
';
+ setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
}
}
@@ -124,11 +122,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
$res = $object->update_date($datepaye);
if ($res === 0)
{
- $mesg = ''.$langs->trans('PaymentDateUpdateSucceeded').'
';
+ setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
}
else
{
- $mesg = ''.$langs->trans('PaymentDateUpdateFailed').'
';
+ setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
}
}
@@ -229,8 +227,6 @@ if ($result > 0)
print '
';
- dol_htmloutput_mesg($mesg);
-
print ' ';
/**
diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php
index 3e9d2bfd590..a7a98dcc734 100644
--- a/htdocs/ftp/admin/ftpclient.php
+++ b/htdocs/ftp/admin/ftpclient.php
@@ -91,7 +91,6 @@ if ($action == 'add' || GETPOST('modify','alpha'))
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
{
$db->commit();
- //$mesg=''.$langs->trans("Success").'
';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@@ -119,7 +118,6 @@ if (GETPOST('delete','alpha'))
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
{
$db->commit();
- //$mesg=''.$langs->trans("Success").'
';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 0c72bcc1b1a..f1a051bcf2a 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -100,8 +100,6 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0);
if (is_numeric($resupload) && $resupload > 0)
{
- //$mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else {
@@ -124,7 +122,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
// Echec transfert (fichier depassant la limite ?)
$langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFailToCreateDir",$upload_dir).'
';
+ setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
}
}
@@ -143,7 +141,8 @@ if ($_POST["action"] == 'add' && $user->rights->ftp->setup)
}
else
{
- $mesg='Error '.$langs->trans($ecmdir->error).'
';
+ //TODO: Translate
+ setEventMessage('Error '.$langs->trans($ecmdir->error));
$_GET["action"] = "create";
}
}
@@ -175,12 +174,12 @@ if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes'
$result=@ftp_delete($conn_id, $newremotefileiso);
if ($result)
{
- $mesg = ''.$langs->trans("FileWasRemoved",$file).'
';
+ setEventMessage($langs->trans("FileWasRemoved",$file));
}
else
{
dol_syslog("ftp/index.php ftp_delete", LOG_ERR);
- $mesg = ''.$langs->trans("FTPFailedToRemoveFile",$file).'
';
+ setEventMessage($langs->trans("FTPFailedToRemoveFile",$file), 'errors');
}
//ftp_close($conn_id); Close later
@@ -225,12 +224,12 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De
$result=@ftp_delete($conn_id, $newremotefileiso);
if ($result)
{
- $mesg .= ''.$langs->trans("FileWasRemoved",$file).'
';
+ setEventMessage($langs->trans("FileWasRemoved",$file));
}
else
{
dol_syslog("ftp/index.php ftp_delete", LOG_ERR);
- $mesg .= ''.$langs->trans("FTPFailedToRemoveFile",$file).'
';
+ setEventMessage($langs->trans("FTPFailedToRemoveFile",$file), 'errors');
}
//ftp_close($conn_id); Close later
@@ -269,11 +268,11 @@ if ($_REQUEST['action'] == 'confirm_deletesection' && $_REQUEST['confirm'] == 'y
$result=@ftp_rmdir($conn_id, $newremotefileiso);
if ($result)
{
- $mesg = ''.$langs->trans("DirWasRemoved",$file).'
';
+ setEventMessage($langs->trans("DirWasRemoved",$file));
}
else
{
- $mesg = ''.$langs->trans("FTPFailedToRemoveDir",$file).'
';
+ setEventMessage($langs->trans("FTPFailedToRemoveDir",$file), 'errors');
}
//ftp_close($conn_id); Close later
@@ -340,7 +339,8 @@ if ($_REQUEST['action'] == 'download')
}
else
{
- $mesg='Failed to get file '.$remotefile.'
';
+ //TODO: Translate
+ setEventMessage('Failed to get file '.$remotefile, 'errors');
}
}
@@ -444,9 +444,6 @@ else
print ' ';
print " \n";
- if ($mesg) { print $mesg." "; }
-
-
print '
";
-
- if (! $ok && $mesg) print $mesg;
-
// Actions
/*
if ($user->rights->ftp->write && ! empty($section))
diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php
index 2b265711fa1..aabf8362c05 100644
--- a/htdocs/holiday/admin/holiday.php
+++ b/htdocs/holiday/admin/holiday.php
@@ -142,9 +142,9 @@ if ($action == "add")
if ($error)
{
- $message = ''.$langs->trans('ErrorUpdateConfCP').'
';
+ setEventMessage($langs->trans('ErrorUpdateConfCP'), 'errors');
} else {
- $message = ''.$langs->trans('UpdateConfCPOK').'
';
+ setEventMessage($langs->trans('UpdateConfCPOK'));
}
// Si première mise à jour, prévenir l'utilisateur de mettre à jour le solde des congés payés
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index 0ac67b66579..bf1bf046783 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -84,10 +84,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
dol_syslog('define_holiday update lastUpdate entry', LOG_DEBUG);
$result = $db->query($sql);
- $mesg=''.$langs->trans('UpdateConfCPOK').'
';
-
- dol_htmloutput_mesg($mesg);
-
+ setEventMessage($langs->trans('UpdateConfCPOK'));
}
elseif($action == 'add_event')
{
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 41a82de36b1..0b4856fab61 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -138,11 +138,11 @@ if ($action == 'builddoc')
$result=$objimport->build_file($user, GETPOST('model','alpha'), $datatoimport, $array_match_file_to_database);
if ($result < 0)
{
- $mesg=''.$objimport->error.'
';
+ setEventMessage($objimport->error, 'errors');
}
else
{
- $mesg=''.$langs->trans("FileSuccessfullyBuilt").'
';
+ setEventMessage($langs->trans("FileSuccessfullyBuilt"));
}
}
@@ -175,21 +175,23 @@ if ($action == 'add_import_model')
$result = $objimport->create($user);
if ($result >= 0)
{
- $mesg=''.$langs->trans("ImportModelSaved",$objimport->model_name).'
';
+ setEventMessage($langs->trans("ImportModelSaved",$objimport->model_name));
}
else
{
$langs->load("errors");
if ($objimport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
- $mesg=''.$langs->trans("ErrorImportDuplicateProfil").'
';
+ setEventMessage($langs->trans("ErrorImportDuplicateProfil"), 'errors');
+ }
+ else {
+ setEventMessage($objimport->error, 'errors');
}
- else $mesg=''.$objimport->error.'
';
}
}
else
{
- $mesg=''.$langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")).'
';
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")), 'errors');
}
}
@@ -385,8 +387,6 @@ if ($step == 1 || ! $datatoimport)
dol_fiche_end();
- if ($mesg) print $mesg;
-
}
@@ -461,7 +461,6 @@ if ($step == 2 && $datatoimport)
dol_fiche_end();
- if ($mesg) print $mesg;
}
@@ -597,10 +596,7 @@ if ($step == 3 && $datatoimport)
print '