From 88356acc3ad3d3a124808f518481c5087b435d81 Mon Sep 17 00:00:00 2001 From: simnandez Date: Wed, 14 Aug 2013 11:11:49 +0200 Subject: [PATCH] [ task #1036 ] Normalized usage of setEventMessage instead of dol_htmloutput_mesg: Init works in admin --- htdocs/admin/accounting.php | 16 +++++++--------- htdocs/admin/agenda.php | 8 ++------ htdocs/admin/agenda_extsites.php | 9 +++------ htdocs/admin/agenda_other.php | 4 +--- htdocs/admin/agenda_xcal.php | 2 +- htdocs/admin/bank.php | 12 +++++------- htdocs/admin/barcode.php | 12 +++++------- htdocs/admin/clicktodial.php | 9 +++------ htdocs/admin/commande.php | 20 +++++++++----------- 9 files changed, 36 insertions(+), 56 deletions(-) diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index fc6c83b356144..d960b60516c52 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2012 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -48,11 +48,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -67,11 +67,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -88,11 +88,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -255,8 +255,6 @@ print "\n"; } -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index bdf2851855eeb..a0f6242440328 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -84,13 +84,11 @@ if (! $error) { - $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $db->rollback(); - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -189,8 +187,6 @@ print "
"; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 3e917ce03fc07..e7ca2216bf340 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -1,6 +1,6 @@ - * 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 @@ -97,12 +97,12 @@ if (! $error) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - if (empty($errorsaved)) $mesg = "".$langs->trans("Error").""; + if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); } } @@ -225,9 +225,6 @@ dol_fiche_end(); -dol_htmloutput_mesg($mesg); - - llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index cffbed706cee6..0a2e0ac0a7e1a 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -1,7 +1,7 @@ * Copyright (C) 2011 Regis Houssin - * 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 @@ -127,8 +127,6 @@ print "
"; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 2aa5992b5afad..beb7960e4a0bc 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9fc80d8b3f7c4..204d84fddf646 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -54,11 +54,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -177,13 +177,13 @@ if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) { print ''; - print img_picto($langs->trans("Activated"),'on'); + print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { print ''; - print img_picto($langs->trans("Disabled"),'off'); + print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } print ' '; @@ -193,8 +193,6 @@ print ''."\n"; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index e54fd7a9cf18f..2e815919672a2 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 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 @@ -79,14 +79,14 @@ { if (! $res > 0) $error++; - if (! $error) + if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; - } + setEventMessage($langs->trans("Error"),'errors'); + } } /* @@ -329,8 +329,6 @@ print "
"; -dol_htmloutput_mesg($mesg); - $db->close(); llxFooter(); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 41a3f02838df1..80428160e802a 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur - * Copyright (C) 2011 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 @@ -41,11 +41,11 @@ $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); if ($result >= 0) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -128,9 +128,6 @@ } } -dol_htmloutput_mesg($mesg); - - llxFooter(); $db->close(); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index cdcd9008c58e0..e24800d18f293 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * Copyright (C) 2013 Florian Henry * @@ -64,11 +64,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -106,13 +106,13 @@ } 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); } } @@ -167,11 +167,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } @@ -185,11 +185,11 @@ if (! $error) { - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { - $mesg = "".$langs->trans("Error").""; + setEventMessage($langs->trans("Error"),'errors'); } } else if ($action=='setModuleOptions') { @@ -531,8 +531,6 @@ print '
'; -dol_htmloutput_mesg($mesg); - llxFooter(); $db->close();