[ task #1036 ] Normalized usage of setEventMessage instead of

dol_htmloutput_mesg: Works in admin
This commit is contained in:
simnandez 2013-08-14 12:48:00 +02:00
parent 88356acc3a
commit fa5f09d6e0
18 changed files with 151 additions and 186 deletions

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
@ -41,8 +41,7 @@ $langs->load("companies");
if (! $user->admin) accessforbidden();
$message='';
$error=0;
/*
* Actions
@ -122,18 +121,21 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
}
else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
{
$error++;
$langs->load("errors");
$tmparray=explode(':',$result);
$message .= '<div class="error">'.$langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]).'</div>';
setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors');
}
else
{
$message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>';
$error++;
setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors');
}
}
else
{
$message .= '<div class="error">'.$langs->trans("ErrorOnlyPngJpgSupported").'</div>';
$error++;
setEventMessage($langs->trans("ErrorOnlyPngJpgSupported"),'errors');
}
}
}
@ -157,7 +159,7 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity);
if ($action != 'updateedit' && ! $message)
if ($action != 'updateedit' && ! $error)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
@ -198,13 +200,15 @@ if ($action == 'addthumb')
}
else
{
$message .= '<div class="error">'.$langs->trans("ErrorImageFormatNotSupported").'</div>';
$error++;
setEventMessage($langs->trans("ErrorImageFormatNotSupported"),'errors');
dol_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING);
}
}
else
{
$message .= '<div class="error">'.$langs->trans("ErrorFileDoesNotExists",$_GET["file"]).'</div>';
$error++;
setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors');
dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
}
}
@ -628,8 +632,6 @@ else
* Show parameters
*/
dol_htmloutput_mesg($message);
// Actions buttons
//print '<div class="tabsAction">';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';

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) 2013 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
@ -52,11 +52,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');
}
}
@ -74,11 +74,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');
}
}
@ -214,8 +214,6 @@ if ($num)
print "</table>\n";
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 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
@ -44,7 +45,6 @@ $constnote=GETPOST('constnote','alpha');
$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine');
$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
$mesg='';
@ -58,12 +58,12 @@ if ($action == 'add')
if (empty($constname))
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")),'errors');
$error++;
}
if ($constvalue == '')
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")),'errors');
$error++;
}
@ -174,8 +174,6 @@ print_fiche_titre($langs->trans("OtherSetup"),'','setup');
print $langs->trans("ConstDesc")."<br>\n";
print "<br>\n";
dol_htmloutput_mesg($mesg);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';

View File

@ -1,5 +1,5 @@
<?php
/* 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>
*
* This program is free software; you can redistribute it and/or modify
@ -53,13 +53,13 @@ if ($action == 'updateMask')
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');
}
}
@ -199,8 +199,6 @@ if (is_resource($handle))
print '</table><br>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
@ -404,7 +404,6 @@ if ($id == 10)
);
if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
}
$msg='';
// Actions ajout ou modification d'une entree dans un dictionnaire de donnee
@ -442,20 +441,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
$msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'<br>';
setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors');
}
}
// Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0;
$msg.= $langs->transnoentities('ErrorReservedTypeSystemSystemAuto').'<br>';
$ok=0;
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
}
if (isset($_POST["code"]))
{
if ($_POST["code"]=='0')
{
$ok=0;
$msg.= $langs->transnoentities('ErrorCodeCantContainZero').'<br>';
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
}
// FIXME regresion if code with not in numeric base
/*if (!is_numeric($_POST['code']))
@ -466,7 +465,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
}
if (isset($_POST["country"]) && $_POST["country"]=='0') {
$ok=0;
$msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'<br>';
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors');
}
// Clean some parameters
@ -530,7 +529,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
else
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$msg=$langs->transnoentities("ErrorRecordAlreadyExists").'<br>';
setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors');
}
else {
dol_print_error($db);
@ -574,11 +573,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$resql = $db->query($sql);
if (! $resql)
{
$msg=$db->error();
setEventMessage($db->error(),'errors');
}
}
if ($msg) $msg='<div class="error">'.$msg.'</div>';
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
}
@ -600,7 +597,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
{
$msg='<div class="error">'.$langs->transnoentities("ErrorRecordIsUsedByChild").'</div>';
setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors');
}
else
{
@ -688,7 +685,6 @@ if ($action == 'delete')
*/
if ($id)
{
dol_htmloutput_mesg($msg);
// Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$id];

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005-2010 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) 2013 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
@ -65,13 +65,13 @@ if ($action == 'specimen')
}
else
{
$mesg='<div class="error">'.$obj->error.'</div>';
setEventMessage($obj->error,'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -160,7 +160,7 @@ else
dol_print_error($db);
}
print '<table class="noborder" width=\"100%\">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
@ -206,20 +206,20 @@ if (is_resource($handle))
print "<td align=\"center\">\n";
if ($conf->global->DON_ADDON_MODEL == $name)
{
print img_picto($langs->trans("Enabled"),'on');
print img_picto($langs->trans("Enabled"),'switch_on');
}
else
{
print '&nbsp;';
print '</td><td align="center">';
print '<a href="dons.php?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
print '<a href="dons.php?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
print '</td>';
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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
@ -60,7 +61,7 @@ if ($action == "save")
}
$db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
@ -116,10 +117,6 @@ print "</form>\n";
print '</div>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -68,11 +68,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');
}
}
@ -110,13 +110,13 @@ 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);
}
}
@ -138,11 +138,11 @@ if ($action == 'setModuleOptions')
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');
}
}
@ -199,11 +199,11 @@ if ($action == 'setribchq')
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');
}
}
@ -217,11 +217,11 @@ if ($action == 'set_FACTURE_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');
}
}
@ -235,11 +235,11 @@ if ($action == 'set_FACTURE_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');
}
}
@ -253,11 +253,11 @@ if ($action == 'setforcedate')
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');
}
}
@ -788,9 +788,6 @@ print "</table>\n";
//dol_fiche_end();
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-20113 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
@ -94,7 +94,7 @@ if (GETPOST('save','alpha'))
{
$res=dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield'),'chaine',0,'',$conf->entity);
if ($res > 0) $mesg=$langs->trans("RecordModifiedSuccessfully");
if ($res > 0) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
@ -151,8 +151,6 @@ else
print '</table>'."\n";
dol_htmloutput_mesg($mesg);
print '<br>'."\n";
print_fiche_titre($langs->trans("TestSubmitForm"),'','');
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* 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>
*
* This program is free software; you can redistribute it and/or modify
@ -60,11 +60,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');
}
}
@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter
}
else
{
$mesg='<font class="error">'.$obj->error.'</font>';
setEventMessage($obj->error,'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
else
{
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
@ -163,11 +163,11 @@ else if ($action == 'set_FICHINTER_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');
}
}
@ -181,11 +181,11 @@ else if ($action == 'set_FICHINTER_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');
}
}
@ -198,11 +198,11 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
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');
}
}
@ -509,8 +509,6 @@ print '</table>';
print '<br>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009-2012 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
@ -46,7 +46,7 @@ if ($action == 'set')
if (! $gimcdf && ! file_exists($gimcdf))
{
$mesg='<div class="error">'.$langs->trans("ErrorFileNotFound",$gimcdf).'</div>';
setEventMessage($langs->trans("ErrorFileNotFound",$gimcdf),'errors');
$error++;
}
@ -56,13 +56,13 @@ if ($action == 'set')
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
}
@ -155,8 +155,6 @@ if ($geoip)
$geoip->close();
}
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -60,15 +60,15 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',GETPOST("activecontact"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE',GETPOST("activemembers"),'chaine',0,'',$conf->entity)) $error++;
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
}
else
{
$db->rollback();
dol_print_error($db);
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
dol_print_error($db);
}
}
@ -89,7 +89,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
}
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
@ -323,8 +323,6 @@ if (function_exists("ldap_connect"))
}
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -72,23 +72,23 @@ if ($action == 'setvalue' && $user->admin)
$key=GETPOST("key");
if ($key) $valkey=$conf->global->$key;
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS',$valkey,'chaine',0,'',$conf->entity)) $error++;
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
}
else
{
$db->rollback();
dol_print_error($db);
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
dol_print_error($db);
}
}
/*
* Visu
* View
*/
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:M&oacute;dulo_LDAP');
@ -101,7 +101,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
}
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
@ -328,8 +328,6 @@ if (function_exists("ldap_connect"))
}
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -64,16 +64,16 @@ if ($action == 'setvalue' && $user->admin)
$key=GETPOST("key");
if ($key) $valkey=$conf->global->$key;
if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS',$valkey,'chaine',0,'',$conf->entity)) $error++;
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
}
else
{
$db->rollback();
dol_print_error($db);
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
dol_print_error($db);
}
}
@ -93,7 +93,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
}
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
@ -253,8 +253,6 @@ if (function_exists("ldap_connect"))
}
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -87,15 +87,15 @@ if ($action == 'setvalue' && $user->admin)
if ($key) $valkey=$conf->global->$key;
if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$valkey,'chaine',0,'',$conf->entity)) $error++;
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
}
else
{
$db->rollback();
dol_print_error($db);
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
dol_print_error($db);
}
}
@ -115,7 +115,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
}
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
@ -436,8 +436,6 @@ if (function_exists("ldap_connect"))
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -74,15 +74,15 @@ if ($action == 'setvalue' && $user->admin)
if ($key) $valkey=$conf->global->$key;
if (! dolibarr_set_const($db, 'LDAP_KEY_USERS',$valkey,'chaine',0,'',$conf->entity)) $error++;
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
}
else
{
$db->rollback();
dol_print_error($db);
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
dol_print_error($db);
}
}
@ -102,7 +102,7 @@ $head = ldap_prepare_head();
// Test si fonction LDAP actives
if (! function_exists("ldap_connect"))
{
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
}
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
@ -440,8 +440,6 @@ if (function_exists("ldap_connect"))
}
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 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-2013 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
@ -56,13 +56,13 @@ if ($action == 'updateMask')
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');
}
}
@ -73,13 +73,13 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
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');
}
}
@ -117,13 +117,13 @@ 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);
}
}
@ -458,8 +458,6 @@ print '</form>';
print '</table>';
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-2012 Laurent Destailleur <eldy@users.sourceforge.org>
* 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
@ -80,16 +80,16 @@ if ($action == 'setvalue')
}
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
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');
}
}
@ -113,9 +113,6 @@ $h++;
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';