[ task #1036 ] Normalized usage of setEventMessage instead of

dol_htmloutput_mesg: Init works in admin
This commit is contained in:
simnandez 2013-08-14 11:11:49 +02:00
parent 8ba3410766
commit 88356acc3a
9 changed files with 36 additions and 56 deletions

View File

@ -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
@ -48,11 +48,11 @@ if ($action == 'setcomptamode')
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');
}
}
@ -67,11 +67,11 @@ if ($action == 'setchart')
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');
}
}
@ -88,11 +88,11 @@ if ($action == 'update' || $action == 'add')
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');
}
}
@ -255,8 +255,6 @@ if ($num)
print "</table>\n";
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -84,13 +84,11 @@ if ($action == "save" && empty($cancel))
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');
}
}
@ -189,8 +187,6 @@ dol_fiche_end();
print "<br>";
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -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
@ -97,12 +97,12 @@ if ($actionsave)
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');
}
}
@ -225,9 +225,6 @@ print "</form>\n";
dol_fiche_end();
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -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
@ -127,8 +127,6 @@ dol_fiche_end();
print "<br>";
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -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

View File

@ -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
@ -54,11 +54,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
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');
}
}
@ -177,13 +177,13 @@ while ($i < $nbofbank)
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>';
@ -193,8 +193,6 @@ while ($i < $nbofbank)
print '</table>'."\n";
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -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
@ -79,14 +79,14 @@ if($action && $action!='setcoder')
{
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');
}
}
/*
@ -329,8 +329,6 @@ print '</table>';
print "<br>";
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -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
@ -41,11 +41,11 @@ if ($action == 'setvalue' && $user->admin)
$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');
}
}
@ -128,9 +128,6 @@ if (! empty($conf->global->CLICKTODIAL_URL))
}
}
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -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>
*
@ -64,11 +64,11 @@ if ($action == 'updateMask')
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');
}
}
@ -106,13 +106,13 @@ else if ($action == 'specimen')
}
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);
}
}
@ -167,11 +167,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
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');
}
}
@ -185,11 +185,11 @@ else if ($action == 'set_COMMANDE_FREE_TEXT')
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') {
@ -531,8 +531,6 @@ print '</table>';
print '<br>';
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();