diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 51a9f9b7728..659fcfb829f 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -46,12 +47,12 @@ if ($action == 'setvalue' && $user->admin) { $result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM",$_POST["email_from"],'chaine',0,'',$conf->entity); if ($result >= 0) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); } } @@ -126,8 +127,6 @@ foreach($listofnotifiedevents as $notifiedevent) } print ''; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 0c87c347e5c..798eadc04c8 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * * 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 @@ -76,15 +76,13 @@ if ($action == "set") else $error++; if (! $error) - { - $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $db->rollback(); - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == "addnotif") @@ -278,8 +276,6 @@ if ($resql) print ''; print ''; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 5ca73fa0de3..de01582048d 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * 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 @@ -48,7 +48,7 @@ $type='propal'; /* * Actions */ - +$error=0; if ($action == 'updateMask') { $maskconstpropal=GETPOST('maskconstpropal','alpha'); @@ -58,13 +58,13 @@ if ($action == 'updateMask') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'specimen') @@ -101,13 +101,13 @@ if ($action == 'specimen') } else { - $mesg=''.$module->error.''; + setEventMessage($module->error,'errors'); dol_syslog($module->error, LOG_ERR); } } else { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; + setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -120,13 +120,13 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'set_PROPALE_FREE_TEXT') @@ -138,13 +138,13 @@ if ($action == 'set_PROPALE_FREE_TEXT') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } if ($action == 'setdefaultduration') @@ -154,13 +154,13 @@ if ($action == 'setdefaultduration') if (! $res > 0) $error++; if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } } // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) @@ -183,12 +183,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -601,8 +601,6 @@ print "\n"; print "\n ".$langs->trans("PathDirectory")."\n ".$conf->propal->dir_output."\n\n"; print "\n
"; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 5fe56bafaea..e78e86991cb 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -1,5 +1,6 @@ + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -43,12 +44,12 @@ if (GETPOST("action") == 'set_proxy') { if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) { - $mesg='
'.$langs->trans("ErrorValueMustBeInteger").'
'; + setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors'); $error++; } if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) { - $mesg='
'.$langs->trans("ErrorValueMustBeInteger").'
'; + setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors'); $error++; } @@ -67,7 +68,7 @@ if (GETPOST("action") == 'set_proxy') if (! $error) { - $mesg='
'.$langs->trans("RecordModifiedSuccessfully").'
'; + setEventMessage($langs->trans("RecordModifiedSuccessfully")); } } @@ -203,10 +204,6 @@ print ''; print '
'; - -dol_htmloutput_mesg($mesg); - - $db->close(); llxFooter();