Skip to content

Commit

Permalink
[ task #1036 ] Normalized usage of setEventMessage instead of
Browse files Browse the repository at this point in the history
dol_htmloutput_mesg: Init works in admin
  • Loading branch information
simnandez committed Aug 14, 2013
1 parent 8ba3410 commit 88356ac
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 56 deletions.
16 changes: 7 additions & 9 deletions htdocs/admin/accounting.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -48,11 +48,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}

}
Expand All @@ -67,11 +67,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand All @@ -88,11 +88,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand Down Expand Up @@ -255,8 +255,6 @@
print "</table>\n";
}

dol_htmloutput_mesg($mesg);

$db->close();

llxFooter();
Expand Down
8 changes: 2 additions & 6 deletions htdocs/admin/agenda.php
Expand Up @@ -84,13 +84,11 @@

if (! $error)
{
$db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand Down Expand Up @@ -189,8 +187,6 @@

print "<br>";

dol_htmloutput_mesg($mesg);

llxFooter();

$db->close();
Expand Down
9 changes: 3 additions & 6 deletions htdocs/admin/agenda_extsites.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
Expand Down Expand Up @@ -97,12 +97,12 @@
if (! $error)
{
$db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
if (empty($errorsaved)) $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors');
}
}

Expand Down Expand Up @@ -225,9 +225,6 @@

dol_fiche_end();

dol_htmloutput_mesg($mesg);


llxFooter();

$db->close();
Expand Down
4 changes: 1 addition & 3 deletions htdocs/admin/agenda_other.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
Expand Down Expand Up @@ -127,8 +127,6 @@

print "<br>";

dol_htmloutput_mesg($mesg);

llxFooter();

$db->close();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/agenda_xcal.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down
12 changes: 5 additions & 7 deletions htdocs/admin/bank.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -54,11 +54,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand Down Expand Up @@ -177,13 +177,13 @@
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
{
print '<td align="center">';
print img_picto($langs->trans("Activated"),'on');
print img_picto($langs->trans("Activated"),'switch_on');
print '</td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&amp;value='.$i.'">';
print img_picto($langs->trans("Disabled"),'off');
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print '<td>&nbsp;</td>';
Expand All @@ -193,8 +193,6 @@

print '</table>'."\n";

dol_htmloutput_mesg($mesg);

$db->close();

llxFooter();
Expand Down
12 changes: 5 additions & 7 deletions htdocs/admin/barcode.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
Expand Down Expand Up @@ -79,14 +79,14 @@
{
if (! $res > 0) $error++;

if (! $error)
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
setEventMessage($langs->trans("Error"),'errors');
}
}

/*
Expand Down Expand Up @@ -329,8 +329,6 @@

print "<br>";

dol_htmloutput_mesg($mesg);

$db->close();

llxFooter();
Expand Down
9 changes: 3 additions & 6 deletions htdocs/admin/clicktodial.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
Expand Down Expand Up @@ -41,11 +41,11 @@
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity);
if ($result >= 0)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand Down Expand Up @@ -128,9 +128,6 @@
}
}

dol_htmloutput_mesg($mesg);


llxFooter();

$db->close();
Expand Down
20 changes: 9 additions & 11 deletions htdocs/admin/commande.php
Expand Up @@ -6,7 +6,7 @@
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
Expand Down Expand Up @@ -64,11 +64,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand Down Expand Up @@ -106,13 +106,13 @@
}
else
{
$mesg='<font class="error">'.$module->error.'</font>';
setEventMessage($module->error,'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
Expand Down Expand Up @@ -167,11 +167,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}

Expand All @@ -185,11 +185,11 @@

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
setEventMessage($langs->trans("Error"),'errors');
}
}
else if ($action=='setModuleOptions') {
Expand Down Expand Up @@ -531,8 +531,6 @@

print '<br>';

dol_htmloutput_mesg($mesg);

llxFooter();

$db->close();
Expand Down

0 comments on commit 88356ac

Please sign in to comment.