Merge pull request #1756 from marcosgdf/messages

Migrated old message notifications to the """new""" system
This commit is contained in:
Laurent Destailleur 2014-07-20 04:57:09 +02:00
commit bf926cd791
114 changed files with 597 additions and 918 deletions

View File

@ -68,11 +68,11 @@ if ($action == 'update' || $action == 'add')
if (! $error)
{
$mesg = '<div class="ok">'.$langs->trans("SetupSaved").'</div>';
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$mesg = '<div class="error">'.$langs->trans("Error").'</div>';
setEventMessage($langs->trans("Error"), 'errors');
}
}
@ -117,10 +117,6 @@ $head = member_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
dol_htmloutput_mesg($mesg);
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -60,11 +60,11 @@ if ($action == 'update')
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');
}
}
@ -86,8 +86,6 @@ $head = member_admin_prepare_head();
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
dol_htmloutput_mesg($mesg);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';

View File

@ -52,7 +52,6 @@ $object = new Adherent($db);
$extrafields = new ExtraFields($db);
$adht = new AdherentType($db);
$errmsg='';
$errmsgs=array();
$defaultdelay=1;
$defaultdelayunit='y';
@ -108,7 +107,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{
$langs->load("errors");
$errmsg=$langs->trans($company->error);
$errmsgs=$company->errors;
setEventMessage($company->errors, 'errors');
}
else
{
@ -129,7 +128,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights
if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly").'</div>';
setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors');
}
}
@ -165,7 +164,7 @@ if ($action == 'setsocid')
$thirdparty=new Societe($db);
$thirdparty->fetch(GETPOST('socid','int'));
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'</div>';
setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors');
}
}
@ -282,7 +281,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
{
$error++;
$errmsg=$object->error;
$errmsgs=$object->errors;
setEventMessage($object->errors, 'errors');
}
if (! $error)
@ -444,7 +443,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if (! ($bank_line_id > 0))
{
$errmsg=$paiement->error;
$errmsgs=$paiement->errors;
setEventMessage($paiement->errors, 'errors');
$error++;
}
}
@ -689,7 +688,7 @@ if ($rowid)
dol_fiche_end();
dol_htmloutput_errors($errmsg,$errmsgs);
dol_htmloutput_errors($errmsg);
/*

View File

@ -81,8 +81,6 @@ if (! empty($canvas))
// Security check
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
$errmsg=''; $errmsgs=array();
if ($rowid > 0)
{
// Load member
@ -128,7 +126,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights
if ($userid != $user->id && $userid != $object->user_id)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly").'</div>';
setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors');
}
}
@ -164,7 +162,7 @@ if ($action == 'setsocid')
$thirdparty=new Societe($db);
$thirdparty->fetch($socid);
$error++;
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'</div>';
setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors');
}
}
@ -190,12 +188,12 @@ if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user
if ($result < 0)
{
$langs->load("errors");
$errmsg=$langs->trans($nuser->error);
setEventMessage($langs->trans($nuser->error), 'errors');
}
}
else
{
$errmsg=$object->error;
setEventMessage($object->error, 'errors');
}
}
@ -211,13 +209,13 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
if ($result < 0)
{
$langs->load("errors");
$errmsg=$langs->trans($company->error);
$errmsgs=$company->errors;
setEventMessage($langs->trans($company->error), 'errors');
setEventMessage($company->errors, 'errors');
}
}
else
{
$errmsg=$object->error;
setEventMessage($object->error, 'errors');
}
}
@ -231,7 +229,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes')
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
$langs->load("mails");
$mesg=$langs->trans("MailSuccessfulySent", $from, $object->email);
setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email));
}
}
@ -252,12 +250,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors');
}
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors');
}
// Create new object
@ -343,7 +341,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
$newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0)
{
$message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>';
setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors');
}
else
{
@ -359,7 +357,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
}
else
{
$errmsgs[] = "ErrorBadImageFormat";
setEventMessage("ErrorBadImageFormat", 'errors');
}
}
else
@ -387,8 +385,11 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
}
else
{
if ($object->error) $errmsg=$object->error;
else $errmsgs=$object->errors;
if ($object->error) {
setEventMessage($object->error, 'errors');
} else {
setEventMessage($object->errors, 'errors');
}
$action='';
}
}
@ -472,14 +473,14 @@ if ($action == 'add' && $user->rights->adherent->creer)
// Check parameters
if (empty($morphy) || $morphy == "-1") {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature")), 'errors');
}
// Test si le login existe deja
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
if (empty($login)) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Login"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Login")), 'errors');
}
else {
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'";
@ -490,32 +491,32 @@ if ($action == 'add' && $user->rights->adherent->creer)
if ($num) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorLoginAlreadyExists",$login)."<br>\n";
setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors');
}
}
if (empty($pass)) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Password")), 'errors');
}
}
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors');
}
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors');
}
if (! ($typeid > 0)) { // Keep () before !
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type"))."<br>\n";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
}
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorBadEMail",$email)."<br>\n";
setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors');
}
$public=0;
if (isset($public)) $public=1;
@ -536,8 +537,11 @@ if ($action == 'add' && $user->rights->adherent->creer)
{
$db->rollback();
if ($object->error) $errmsg=$object->error;
else $errmsgs=$object->errors;
if ($object->error) {
setEventMessage($object->error, 'errors');
} else {
setEventMessage($object->errors, 'errors');
}
$action = 'create';
}
@ -589,15 +593,18 @@ if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm ==
if ($result < 0)
{
$error++;
$errmsg.=$object->error;
setEventMessage($object->error, 'errors');
}
}
}
else
{
$error++;
if ($object->error) $errmsg=$object->error;
else $errmsgs=$object->errors;
if ($object->error) {
setEventMessage($object->error, 'errors');
} else {
setEventMessage($object->errors, 'errors');
}
}
if (! $error)
@ -613,6 +620,8 @@ if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm ==
if ($user->rights->adherent->supprimer && $action == 'confirm_resign')
{
$error = 0;
if ($confirm == 'yes')
{
$adht = new AdherentType($db);
@ -628,17 +637,23 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_resign')
}
if ($result < 0)
{
$errmsg.=$object->error;
$error++;
setEventMessage($object->error, 'errors');
}
}
else
{
if ($object->error) $errmsg=$object->error;
else $errmsgs=$object->errors;
$error++;
if ($object->error) {
setEventMessage($object->error, 'errors');
} else {
setEventMessage($object->errors, 'errors');
}
$action='';
}
}
if (! empty($backtopage) && ! $errmsg)
if (! empty($backtopage) && ! $error)
{
header("Location: ".$backtopage);
exit;
@ -652,7 +667,7 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $conf
{
if (!$mailmanspip->del_to_spip($object))
{
$errmsg.= $langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error."<BR>\n";
setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors');
}
}
}
@ -663,7 +678,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm
{
if (!$mailmanspip->add_to_spip($object))
{
$errmsg.= $langs->trans('AddIntoSpipError').': '.$mailmanspip->error."<BR>\n";
setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors');
}
}
}
@ -725,9 +740,6 @@ else
print_fiche_titre($langs->trans("NewMember"));
dol_htmloutput_mesg($errmsg,$errmsgs,'error');
dol_htmloutput_mesg($mesg,$mesgs);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
@ -952,9 +964,6 @@ else
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
dol_htmloutput_errors($errmsg,$errmsgs);
dol_htmloutput_mesg($mesg);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
@ -1168,8 +1177,6 @@ else
if ($rowid && $action != 'edit')
{
dol_htmloutput_mesg($mesg);
/* ************************************************************************** */
/* */
/* Mode affichage */
@ -1199,8 +1206,6 @@ else
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
dol_htmloutput_errors($errmsg,$errmsgs);
// Confirm create user
if ($action == 'create_user')
{

View File

@ -282,8 +282,6 @@ if ($rowid && $action != 'edit')
dol_fiche_head($head, 'general', $langs->trans("Subscription"), '', 'payment');
if ($msg) print '<div class="error">'.$msg.'</div>';
// Confirmation to delete subscription
if ($action == 'delete')
{

View File

@ -60,8 +60,6 @@ if (! $result)
if ($action == 'dolibarr2ldap')
{
$message="";
$db->begin();
$ldap=new Ldap();
@ -75,12 +73,12 @@ if ($action == 'dolibarr2ldap')
if ($result >= 0)
{
$message.='<div class="ok">'.$langs->trans("MemberSynchronized").'</div>';
setEventMessage($langs->trans("MemberSynchronized"));
$db->commit();
}
else
{
$message.='<div class="error">'.$ldap->error.'</div>';
setEventMessage($ldap->error, 'errors');
$db->rollback();
}
}
@ -157,10 +155,6 @@ print '</table>';
print '</div>';
dol_htmloutput_mesg($message);
/*
* Barre d'actions
*/

View File

@ -237,8 +237,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewMemberType"));
if ($mesg) print '<div class="error">'.$mesg.'</div>';
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';

View File

@ -34,7 +34,6 @@ if (! $user->admin) accessforbidden();
$rowid = GETPOST('rowid','int');
$action = GETPOST('action','alpha');
$errmesg='';
// Define possible position of boxes
$pos_name = getStaticMember('InfoBox','listOfPages');
@ -80,7 +79,7 @@ if ($action == 'add')
}
else
{
$errmesg=$db->lasterror();
setEventMessage($db->lasterror(), 'errors');
$error++;
}
}
@ -116,7 +115,7 @@ if ($action == 'add')
$resql = $db->query($sql);
if (! $resql)
{
$errmesg=$db->lasterror();
setEventMessage($db->lasterror(), 'errors');
$error++;
}
}
@ -217,9 +216,6 @@ print_fiche_titre($langs->trans("Boxes"),'','setup');
print $langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
dol_htmloutput_errors($errmesg);
/*
* Recherche des boites actives par defaut pour chaque position possible
* On stocke les boites actives par defaut dans $boxes[position][id_boite]=1

View File

@ -105,7 +105,6 @@ if ($action == 'add' || GETPOST("modify"))
if ($result1 && $result2)
{
$db->commit();
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@ -171,7 +170,6 @@ if ($_POST["delete"])
if ($result1 && $result2)
{
$db->commit();
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
header("Location: external_rss.php");
exit;
}

View File

@ -120,7 +120,10 @@ $var=true;
if (empty($conf->use_javascript_ajax))
{
dol_htmloutput_errors('',array($langs->trans("NotAvailable"),$langs->trans("JavascriptDisabled")),1);
setEventMessage(array(
$langs->trans("NotAvailable"),
$langs->trans("JavascriptDisabled")
), 'errors');
}
else
{

View File

@ -43,7 +43,6 @@ static $tmpstatut2label=array(
$statut2label=array('');
foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val);
$mesg='';
$errors=array();
$object = new Fiscalyear($db);
@ -64,8 +63,6 @@ $title = $langs->trans('FiscalYears');
print_fiche_titre($langs->trans('FiscalYears'));
dol_htmloutput_errors($mesg);
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f";
$sql.= " WHERE f.entity = ".$conf->entity;

View File

@ -46,8 +46,6 @@ static $tmpstatut2label=array(
$statut2label=array('');
foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val);
$mesg = '';
$object = new Fiscalyear($db);
$date_start=dol_mktime(0,0,0,GETPOST('fiscalyearmonth','int'),GETPOST('fiscalyearday','int'),GETPOST('fiscalyearyear','int'));
@ -67,7 +65,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
@ -87,12 +85,12 @@ else if ($action == 'add')
if (empty($object->date_start) && empty($object->date_end))
{
$mesg.=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
$error++;
}
if (empty($object->label))
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors');
$error++;
}
@ -107,7 +105,7 @@ else if ($action == 'add')
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
$action='create';
}
}
@ -144,7 +142,7 @@ else if ($action == 'update')
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
else
@ -169,8 +167,6 @@ if ($action == 'create')
{
print_fiche_titre($langs->trans("NewFiscalYear"));
dol_htmloutput_errors($mesg);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
@ -209,8 +205,6 @@ else if ($id)
$result = $object->fetch($id);
if ($result > 0)
{
dol_htmloutput_mesg($mesg);
$head = fiscalyear_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron');

View File

@ -427,7 +427,7 @@ if (function_exists("ldap_connect"))
}
else
{
$mesg='<div class="error">'.$ldap->error.'</div>';
setEventMessage($ldap->error, 'errors');
}
print "<br>\n";

View File

@ -43,7 +43,7 @@ if ($action == 'update')
|| $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC).'</div>';
setEventMessage($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), 'errors');
}
if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0
@ -52,7 +52,7 @@ if ($action == 'update')
{
$langs->load("errors");
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorNegativeValueNotAllowed").'</div>';
setEventMessage($langs->trans("ErrorNegativeValueNotAllowed"), 'errors');
}
if ($_POST["MAIN_ROUNDING_RULE_TOT"])
@ -61,7 +61,7 @@ if ($action == 'update')
{
$langs->load("errors");
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT").'</div>';
setEventMessage($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), 'errors');
}
}
@ -94,8 +94,6 @@ print_fiche_titre($langs->trans("LimitsSetup"),'','setup');
print $langs->trans("LimitsDesc")."<br>\n";
print "<br>\n";
if ($mesg) print $mesg.'<br>';
if ($action == 'edit')
{
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -653,9 +653,13 @@ else
if ($result) print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'</div>';
else
{
print '<div class="error">'.$langs->trans("ServerNotAvailableOnIPOrPort",$server,$port);
if ($mail->error) print ' - '.$mail->error;
print '</div>';
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port);
if ($mail->error) {
$errormsg .= ' - '.$mail->error;
}
setEventMessage($errormsg, 'errors');
}
print '<br>';
}

View File

@ -49,8 +49,6 @@ foreach($dirmenus as $dirmenu)
}
$error=0;
$errmsgs=array();
// Cette page peut etre longue. On augmente le delai autorise.
// Ne fonctionne que si on est pas en safe_mode.
@ -105,7 +103,8 @@ if ($action == 'update' && empty($_POST["cancel"]))
else
{
$error++;
$errmsgs[]='Failed to initialize menu '.$key.'.';
//TODO: Translate
setEventMessage('Failed to initialize menu '.$key.'.', 'errors');
$db->rollback();
}
}
@ -268,10 +267,6 @@ else
print '</div>';
dol_htmloutput_errors('',$errmsgs);
if ($action != 'edit')
{
print '<div class="tabsAction">';

View File

@ -39,7 +39,6 @@ $dirsmartphone = "/core/menus/smartphone";
$dirmenu = array($dirstandard,$dirsmartphone);
$action=GETPOST('action');
$mesg=GETPOST('mesg');
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
@ -79,16 +78,16 @@ if ($action == 'update')
$result=$menu->update($user);
if ($result > 0)
{
$mesg='<div class="ok">'.$langs->trans("RecordModifiedSuccessfully").'</div>';
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else
{
$mesg='<div class="error">'.$menu->error.'</div>';
setEventMessage($menu->error, 'errors');
}
}
else
{
$mesg='<div class="error">'.$menu->error.'</div>';
setEventMessage($menu->error, 'errors');
}
$_GET["menuId"] = $_POST['menuId'];
$action = "edit";
@ -136,37 +135,37 @@ if ($action == 'add')
$error=0;
if (! $error && ! $_POST['menu_handler'])
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")), 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['type'])
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['url'])
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Url")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors');
$action = 'create';
$error++;
}
if (! $error && ! $_POST['titre'])
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors');
$action = 'create';
$error++;
}
if (! $error && $_POST['menuId'] && $_POST['type'] == 'top')
{
$mesg='<div class="error">'.$langs->trans("ErrorTopMenuMustHaveAParentWithId0").'</div>';
setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors');
$action = 'create';
$error++;
}
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
{
$mesg='<div class="error">'.$langs->trans("ErrorLeftMenuMustHaveAParentId").'</div>';
setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors');
$action = 'create';
$error++;
}
@ -205,7 +204,7 @@ if ($action == 'add')
else
{
$action = 'create';
$mesg='<div class="error">'.$menu->error.'</div>';
setEventMessage($menu->error, 'errors');
}
}
}
@ -223,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
$this->db->commit();
llxHeader();
print '<div class="ok">'.$langs->trans("MenuDeleted").'</div>';
setEventMessage($langs->trans("MenuDeleted"));
llxFooter();
exit ;
}
@ -375,8 +374,6 @@ if ($action == 'create')
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
print '</form>';
dol_htmloutput_mesg($mesg);
}
elseif ($action == 'edit')
{
@ -463,8 +460,6 @@ elseif ($action == 'edit')
print '</form>';
print '<br>';
dol_htmloutput_mesg($mesg);
}

View File

@ -43,7 +43,6 @@ foreach($dirmenus as $dirmenu)
$action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$mesg=GETPOST('mesg');
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
@ -187,7 +186,9 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
{
$db->commit();
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler.'&mesg='.urlencode($langs->trans("MenuDeleted")));
setEventMessage($langs->trans("MenuDeleted"));
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler);
exit ;
}
else
@ -216,9 +217,6 @@ llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss);
print_fiche_titre($langs->trans("Menus"),'','setup');
dol_htmloutput_mesg($mesg);
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
@ -360,7 +358,7 @@ if ($conf->use_javascript_ajax)
else
{
$langs->load("errors");
print '<div class="error">'.$langs->trans("ErrorFeatureNeedJavascript").'</div>';
setEventMessage($langs->trans("ErrorFeatureNeedJavascript"), 'errors');
}
print '<br>';

View File

@ -95,11 +95,10 @@ if ($db->type == 'pgsql')
{
// Check option standard_conforming_strings is on
$paramarray=$db->getServerParametersValues('standard_conforming_strings');
if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1)
{
$langs->load("errors");
//print '<div class="error">'.$langs->trans("ErrorDatabaseParameterWrong",'standard_conforming_strings','on').'</div>';
}
// if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1)
// {
// $langs->load("errors");
// }
}
print '<br>';

View File

@ -30,7 +30,9 @@ $langs->load("other");
if (! $user->admin) accessforbidden();
if (GETPOST('msg','alpha')) $message='<div class="error">'.GETPOST('msg','alpha').'</div>';
if (GETPOST('msg','alpha')) {
setEventMessage(GETPOST('msg','alpha'), 'errors');
}
$urldolibarr='http://www.dolibarr.org/downloads/';
@ -54,7 +56,7 @@ if (GETPOST('action','alpha')=='install')
if (! $original_file)
{
$langs->load("Error");
$mesg = '<div class="warning">'.$langs->trans("ErrorFileRequired").'</div>';
setEventMessage($langs->trans("ErrorFileRequired"), 'warnings');
$error++;
}
else
@ -62,7 +64,7 @@ if (GETPOST('action','alpha')=='install')
if (! preg_match('/\.zip/i',$original_file))
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFileMustBeADolibarrPackage",$original_file).'</div>';
setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors');
$error++;
}
}
@ -80,12 +82,11 @@ if (GETPOST('action','alpha')=='install')
if (! empty($result['error']))
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans($result['error'],$original_file).'</div>';
setEventMessage($langs->trans($result['error'],$original_file), 'errors');
}
else
{
$mesg = '<div class="ok">'.$langs->trans("SetupIsReadyForUse").'</div>';
setEventMessage($langs->trans("SetupIsReadyForUse"));
}
}
}
@ -107,9 +108,6 @@ print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("FeatureNotYetAvailable").'</b><br>';
print '<br>';
//dol_htmloutput_errors($mesg);
dol_htmloutput_mesg($mesg);
print $langs->trans("Upgrade").'<br>';
print '<hr>';
print $langs->trans("ThisIsProcessToFollow").'<br>';
@ -152,7 +150,7 @@ if (! empty($conf->global->MAIN_ONLINE_INSTALL_MODULE))
else
{
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
print '<div class="warning">'.$message.'</div>';
setEventMessage($message, 'warnings');
}
}
else

View File

@ -57,8 +57,6 @@ print_fiche_titre($langs->trans("TranslationSetup"),'','setup');
print $langs->trans("TranslationDesc")."<br>\n";
print "<br>\n";
dol_htmloutput_mesg($message);
print $langs->trans("CurrentUserLanguage").': <strong>'.$langs->defaultlang.'</strong><br>';
print img_warning().' '.$langs->trans("SomeTranslationAreUncomplete").'<br>';

View File

@ -37,8 +37,6 @@ $forbarcode=GETPOST('forbarcode');
$fk_barcode_type=GETPOST('fk_barcode_type');
$eraseallbarcode=GETPOST('eraseallbarcode');
$mesg='';
$action=GETPOST('action');
$producttmp=new Product($db);
@ -198,8 +196,6 @@ print '<br>';
print $langs->trans("MassBarcodeInitDesc").'<br>';
print '<br>';
dol_htmloutput_errors($mesg);
//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'<br>';
//print '<br>';

View File

@ -42,12 +42,12 @@ if ($action == 'setvalue')
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');
}
}
@ -82,8 +82,6 @@ print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="'.$conf-
print '</td></tr>';
print '</table><br /><center><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center></form>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -50,6 +50,8 @@ $backtopage=GETPOST('backtopage','alpha');
if ($action == 'add' || $action == 'addproduct' || $action == 'update')
{
$error = 0;
if (GETPOST("cancel"))
{
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/liste.php'));
@ -57,8 +59,6 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
exit;
}
$mesg='';
$bookmark=new Bookmark($db);
if ($action == 'update') $bookmark->fetch($_POST["id"]);
$bookmark->fk_user=$userid;
@ -67,10 +67,17 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
$bookmark->target=$target;
$bookmark->position=$position;
if (! $title) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle"));
if (! $url) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink"));
if (! $title) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle")), 'errors');
}
if (! $mesg)
if (! $url) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink")), 'errors');
}
if (! $error)
{
$bookmark->favicon='none';
@ -88,18 +95,17 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg='<div class="warning">'.$langs->trans("WarningBookmarkAlreadyExists").'</div>';
setEventMessage($langs->trans("WarningBookmarkAlreadyExists"), 'warnings');
}
else
{
$mesg='<div class="error">'.$bookmark->error.'</div>';
setEventMessage($bookmark->error, 'errors');
}
$action='create';
}
}
else
{
$mesg='<div class="error">'.$mesg.'</div>';
$action='create';
}
}
@ -121,7 +127,7 @@ if ($action == 'delete')
}
else
{
$mesg='<div class="error">'.$bookmark->error.'</div>';
setEventMessage($bookmark->error, 'errors');
}
}
@ -149,8 +155,6 @@ if ($action == 'create')
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';

View File

@ -58,7 +58,7 @@ if ($_GET["action"] == 'delete')
}
else
{
$mesg='<div class="error">'.$bookmark->error.'</div>';
$setEventMessage($bookmark->error, 'errors');
}
}
@ -73,8 +73,6 @@ llxHeader();
print_fiche_titre($langs->trans("Bookmarks"));
if ($mesg) print $mesg;
$sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
$sql.= " u.login, u.lastname, u.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";

View File

@ -56,7 +56,7 @@ if (GETPOST('save','alpha'))
if ($i >= 4)
{
$db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("OSCommerceSetupSaved")."</font>";
setEventMessage($langs->trans("OSCommerceSetupSaved"));
}
else
{
@ -88,28 +88,29 @@ elseif (GETPOST('test','alpha'))
$sql.=" WHERE configuration_key='STORE_NAME'";
$resql=$oscommercedb->query($sql);
if ($resql) {
$mesg ="<div class=\"ok\">".$langs->trans("OSCommerceTestOk",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'),GETPOST('oscommerce_dbuser','alpha'));
$mesg.="</div>";
$mesg = $langs->trans("OSCommerceTestOk",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'),GETPOST('oscommerce_dbuser','alpha'));
setEventMessage($mesg);
}
else {
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',GETPOST('oscommerce_db_table_prefix','alpha')."configuration");
$mesg.="</div>";
$mesg = $langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',GETPOST('oscommerce_db_table_prefix','alpha')."configuration");
setEventMessage($mesg, 'errors');
}
//$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
}
elseif ($oscommercedb->connected == 1 && $oscommercedb->database_selected != 1)
{
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo1",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'));
$mesg = $langs->trans("OSCommerceTestKo1",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'));
$mesg.="<br>".$oscommercedb->error();
$mesg.="</div>";
setEventMessage($mesg, 'errors');
//$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
}
else
{
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo2",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbuser','alpha'));
$mesg = $langs->trans("OSCommerceTestKo2",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbuser','alpha'));
$mesg.="<br>".$oscommercedb->error();
$mesg.="</div>";
setEventMessage($mesg, 'errors');
}
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
@ -198,9 +199,6 @@ print "</center>";
print "</form>\n";
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -67,12 +67,12 @@ if (GETPOST('action','alpha') == 'set')
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');
}
}
@ -152,8 +152,6 @@ print '<center><input type="submit" class="button" value="'.$langs->trans("Save"
print "</form>\n";
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -80,12 +80,12 @@ if ($action == 'update' && $user->rights->categorie->creer)
if (empty($categorie->label))
{
$action = 'create';
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
}
if (empty($categorie->description))
{
$action = 'create';
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Description"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors');
}
if (empty($categorie->error))
{
@ -98,12 +98,12 @@ if ($action == 'update' && $user->rights->categorie->creer)
}
else
{
$mesg=$categorie->error;
setEventMessage($categorie->error, 'errors');
}
}
else
{
$mesg=$categorie->error;
setEventMessage($categorie->error, 'errors');
}
}
@ -117,10 +117,6 @@ llxHeader("","",$langs->trans("Categories"));
print_fiche_titre($langs->trans("ModifCat"));
dol_htmloutput_errors($mesg);
$object->fetch($id);
$form = new Form($db);

View File

@ -131,7 +131,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
if (! $object->label)
{
$error++;
$errors[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors');
$action = 'create';
}
@ -224,8 +224,6 @@ if ($user->rights->categorie->creer)
print_fiche_titre($langs->trans("CreateCat"));
dol_htmloutput_errors('',$errors);
print '<table width="100%" class="border">';
// Ref

View File

@ -94,7 +94,7 @@ $cancel != $langs->trans("Cancel") &&
else
{
$action = 'add';
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
@ -127,7 +127,7 @@ $cancel != $langs->trans("Cancel") &&
else
{
$action = 'edit';
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
@ -153,10 +153,6 @@ else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'translation', $title, 0, 'category');
if (! empty($mesg)) {
dol_htmloutput_mesg($mesg);
}
print '<table class="border" width="100%">';
// Reference

View File

@ -32,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("categories");
$mesg = '';
$id=GETPOST('id','int');
$ref=GETPOST('ref');
$type=GETPOST('type');
@ -117,7 +116,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
@ -131,8 +130,6 @@ $form = new Form($db);
llxHeader("","",$langs->trans("Categories"));
dol_htmloutput_mesg($mesg);
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");

View File

@ -156,8 +156,6 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
if ($id > 0 || ! empty($ref))
{
dol_htmloutput_mesg($mesg,$mesgs);
if ($object->fetch($id,$ref) > 0)
{

View File

@ -62,7 +62,6 @@ $result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|
if ($user->societe_id && $socid) $result = restrictedArea($user,'societe',$socid);
$error=GETPOST("error");
$mesg='';
$cactioncomm = new CActionComm($db);
$object = new ActionComm($db);
@ -116,14 +115,14 @@ if ($action == 'add_action')
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors');
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label'))
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")), 'errors');
}
// Initialisation objet cactioncomm
@ -131,7 +130,7 @@ if ($action == 'add_action')
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
}
else
{
@ -201,14 +200,14 @@ if ($action == 'add_action')
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors');
}
if (! GETPOST('apyear') && ! GETPOST('adyear'))
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
}
// Fill array 'array_options' with data from add form
@ -458,8 +457,6 @@ if ($action == 'create')
if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous"));
else print_fiche_titre($langs->trans("AddAnAction"));
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
// Type d'action actifs
@ -644,10 +641,6 @@ if ($id > 0)
{
dol_htmloutput_errors($error);
}
if ($mesg)
{
dol_htmloutput_mesg($mesg);
}
$result=$object->fetch($id);
$object->fetch_optionals($id,$extralabels);

View File

@ -37,9 +37,6 @@ $action=GETPOST('action','alpha');
$month=GETPOST('month');
$year=GETPOST('year');
$mesg='';
$mesgs=array();
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
@ -64,7 +61,7 @@ if ($action == 'builddoc')
$result=$cat->write_file(GETPOST('id','int'));
if ($result < 0)
{
$mesg=$cat->error;
setEventMessage($cat->error, 'errors');
}
}
@ -97,8 +94,6 @@ if ($resql)
print_barre_liste($langs->trans("Actions"), $page, "index.php",'',$sortfield,$sortorder,'',$num);
dol_htmloutput_mesg($mesg,$mesgs);
$i = 0;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -106,7 +106,7 @@ if ($action == 'add' || $action == 'update')
}
else
{
$mesg = $object->error;
setEventMessage($object->error, 'errors');
$action='create';
}
}
@ -147,7 +147,7 @@ if ($action == 'add' || $action == 'update')
else
{
$reload = 0;
$mesg = $object->error;
setEventMessage($object->error, 'errors');
$actino= "edit";
}
}
@ -181,9 +181,6 @@ $form = new Form($db);
$formcompany = new FormCompany($db);
$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
dol_htmloutput_errors($mesg);
if ($action == 'create')
{
if ($user->rights->societe->creer)

View File

@ -87,7 +87,7 @@ if ($action == 'setcustomeraccountancycode')
$result=$object->update($object->id,$user,1,1,0);
if ($result < 0)
{
$mesgs[]=join(',',$object->errors);
setEventMessage($object->errors, 'errors');
}
$action="";
}
@ -926,8 +926,6 @@ else
dol_print_error($db,'Bad value for socid parameter');
}
dol_htmloutput_mesg('',$mesgs);
// End of page
llxFooter();

View File

@ -38,8 +38,6 @@ $langs->load("mails");
if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden();
$mesg = '';
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
@ -222,8 +220,6 @@ if ($object->fetch($id) >= 0)
print "</div>";
dol_htmloutput_mesg($mesg);
$var=!$var;
$allowaddtarget=($object->statut == 0);

View File

@ -107,7 +107,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
else
{
@ -119,7 +119,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
$action='';
@ -130,16 +130,17 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
{
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{
//TODO: What is this for?
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message
$mesg='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
$mesg.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>';
$mesg.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
setEventMessage('<textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
$action='';
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
$mesg='<div class="warning">'.$langs->trans("NotEnoughPermissions").'</div>';
setEventMessage($langs->trans("NotEnoughPermissions"), 'warnings');
$action='';
}
else
@ -390,7 +391,7 @@ if ($action == 'send' && empty($_POST["cancel"]))
$object->sendto = $_POST["sendto"];
if (! $object->sendto)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("MailTo")), 'errors');
$error++;
}
@ -430,11 +431,11 @@ if ($action == 'send' && empty($_POST["cancel"]))
$result=$mailfile->sendfile();
if ($result)
{
$mesg='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)).'</div>';
setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)));
}
else
{
$mesg='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, 'errors');
}
$action='';
@ -444,6 +445,8 @@ if ($action == 'send' && empty($_POST["cancel"]))
// Action add emailing
if ($action == 'add')
{
$mesgs = array();
$object->email_from = trim($_POST["from"]);
$object->email_replyto = trim($_POST["replyto"]);
$object->email_errorsto = trim($_POST["errorsto"]);
@ -453,21 +456,27 @@ if ($action == 'add')
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->titre) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $object->titre) {
$mesgs[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
}
if (! $object->sujet) {
$mesgs[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
}
if (! $object->body) {
$mesgs[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
}
if (! $mesg)
if (!count($mesgs))
{
if ($object->create($user) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
$mesgs[] = $object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
setEventMessage($mesgs, 'errors');
$action="create";
}
@ -480,9 +489,12 @@ if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyt
else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
else if ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto','alpha'));
else if ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
else if ($action == 'settitre' && empty($object->titre)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
else if ($action == 'setfrom' && empty($object->email_from)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
else if ($action == 'settitre' && empty($object->titre)) {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
}
else if ($action == 'setfrom' && empty($object->email_from)) {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
}
if (! $mesg)
{
@ -491,10 +503,10 @@ if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyt
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
$mesg = $object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
setEventMessage($mesg, 'errors');
$action="";
}
@ -534,25 +546,31 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
if (! $isupload)
{
$mesgs = array();
$object->sujet = trim($_POST["sujet"]);
$object->body = trim($_POST["body"]);
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $object->sujet) {
$mesgs[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
}
if (! $object->body) {
$mesgs[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
}
if (! $mesg)
if (!count($mesgs))
{
if ($object->update($user) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
$mesgs[] =$object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
setEventMessage($mesgs, 'errors');
$action="edit";
}
else
@ -598,7 +616,7 @@ if ($action == 'confirm_reset' && $confirm == 'yes')
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@ -646,8 +664,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewMailing"));
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
@ -731,9 +747,9 @@ else
{
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message
$mesgembedded.='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
$mesgembedded.='<br><textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>';
$mesgembedded.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
setEventMessage('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
$_GET["action"]='';
}
else
@ -829,9 +845,6 @@ else
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240);
}
dol_htmloutput_mesg($mesg);
/*
* Boutons d'action
*/
@ -916,12 +929,6 @@ else
print '<br><br></div>';
}
if (! empty($mesgembedded))
{
dol_htmloutput_mesg($mesgembedded,'','warning',1);
print '<br>';
}
// Affichage formulaire de TEST
if ($action == 'test')
{
@ -1017,8 +1024,6 @@ else
* Mailing en mode edition
*/
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
// Ref

View File

@ -1645,7 +1645,7 @@ if ($action == 'create') {
$numref = $object->getNextNumRef($soc);
if (empty($numref)) {
$error ++;
dol_htmloutput_errors($object->error);
setEventMessage($object->error, 'errors');
}
} else {
$numref = $object->ref;

View File

@ -71,7 +71,7 @@ if (GETPOST("action") == 'setremise')
}
else
{
$errmesg=$soc->error;
setEventMessage($soc->error, 'errors');
}
}
@ -97,8 +97,6 @@ if ($socid > 0)
$objsoc->id=$socid;
$objsoc->fetch($socid);
dol_htmloutput_errors($errmesg);
$head = societe_prepare_head($objsoc);
dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company');

View File

@ -65,17 +65,17 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
if (! $res > 0)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFailedToLoadDiscount").'</div>';
setEventMessage($langs->trans("ErrorFailedToLoadDiscount"), 'errors');
}
if (! $error && price2num($_POST["amount_ttc_1"]+$_POST["amount_ttc_2"]) != $discount->amount_ttc)
{
$error++;
$mesg='<div class="error">'.$langs->trans("TotalOfTwoDiscountMustEqualsOriginal").'</div>';
setEventMessage($langs->trans("TotalOfTwoDiscountMustEqualsOriginal"), 'errors');
}
if (! $error && $discount->fk_facture_line)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorCantSplitAUsedDiscount").'</div>';
setEventMessage($langs->trans("ErrorCantSplitAUsedDiscount"), 'errors');
}
if (! $error)
{
@ -140,7 +140,7 @@ if ($action == 'setremise')
$error=0;
if (empty($_POST["desc"]))
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")), 'errors');
$error++;
}
@ -166,13 +166,13 @@ if ($action == 'setremise')
else
{
$error++;
$mesg='<div class="error">'.$soc->error.'</div>';
setEventMessage($soc->error, 'errors');
}
}
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")).'</div>';
setEventMessage($langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")), 'errors');
}
}
@ -194,7 +194,7 @@ if (GETPOST("action") == 'confirm_remove' && GETPOST("confirm")=='yes')
}
else
{
$mesg='<div class="error">'.$discount->error.'</div>';
setEventMessage($discount->error, 'errors');
$db->rollback();
}
}
@ -211,8 +211,6 @@ llxHeader('',$langs->trans("GlobalDiscount"));
if ($socid > 0)
{
dol_htmloutput_mesg($mesg);
// On recupere les donnees societes par l'objet
$objsoc = new Societe($db);
$objsoc->id=$socid;

View File

@ -69,11 +69,11 @@ if ($action == 'addcontact' && $user->rights->commande->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -132,7 +132,6 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

View File

@ -65,8 +65,6 @@ $lineid = GETPOST('lineid', 'int');
$origin = GETPOST('origin', 'alpha');
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
$mesg = GETPOST('mesg');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
@ -108,7 +106,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande->
{
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
else
{
@ -201,7 +199,7 @@ else if ($action == 'add' && $user->rights->commande->creer) {
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
if ($datecommande == '') {
$mesg = '<div class="error">' . $langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')) . '</div>';
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors');
$action = 'create';
$error ++;
}
@ -340,11 +338,11 @@ else if ($action == 'add' && $user->rights->commande->creer) {
if ($reshook < 0)
$error ++;
} else {
$mesg = $srcobject->error;
setEventMessage($srcobject->error, 'errors');
$error ++;
}
} else {
$mesg = $object->error;
setEventMessage($object->error, 'errors');
$error ++;
}
} else {
@ -378,7 +376,7 @@ else if ($action == 'add' && $user->rights->commande->creer) {
if (GETPOST('contactidp')) {
$result = $object->add_contact(GETPOST('contactidp'), 'CUSTOMER', 'external');
if ($result < 0) {
$mesg = '<div class="error">' . $langs->trans("ErrorFailedToAddContact") . '</div>';
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
$error ++;
}
}
@ -395,8 +393,7 @@ else if ($action == 'add' && $user->rights->commande->creer) {
} else {
$db->rollback();
$action = 'create';
if (! $mesg)
$mesg = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -435,7 +432,7 @@ else if ($action == 'setdate' && $user->rights->commande->creer) {
$result = $object->set_date($user, $date);
if ($result < 0) {
$mesg = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
}
@ -445,7 +442,7 @@ else if ($action == 'setdate_livraison' && $user->rights->commande->creer) {
$result = $object->set_date_livraison($user, $datelivraison);
if ($result < 0) {
$mesg = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
}
@ -884,7 +881,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
$action='';
}
}
@ -929,7 +926,7 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
$action='';
}
}
@ -982,7 +979,7 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->comm
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
$action='';
}
}
@ -1221,12 +1218,13 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1);
if ($mailfile->error) {
$mesg = '<div class="error">' . $mailfile->error . '</div>';
setEventMessage($mailfile->error, 'errors');
} else {
$result = $mailfile->sendfile();
if ($result) {
$mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)); // Must not
// contains "
//Must not contain quotes
$mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2));
setEventMessage($mesg);
$error = 0;
@ -1253,19 +1251,19 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} else {
// Redirect here
// This avoid sending mail twice if going out and then back to page
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&mesg=' . urlencode($mesg));
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
exit();
}
} else {
$langs->load("other");
$mesg = '<div class="error">';
if ($mailfile->error) {
$mesg .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
$mesg .= '<br>' . $mailfile->error;
} else {
$mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg .= '</div>';
setEventMessage($mesg, 'errors');
}
}
/* }
@ -1278,12 +1276,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}*/
} else {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans('ErrorCantReadFile', $file) . '</div>';
setEventMessage($langs->trans('ErrorCantReadFile', $file), 'errors');
dol_syslog('Failed to read file: ' . $file);
}
} else {
$langs->load("other");
$mesg = '<div class="error">' . $langs->trans('ErrorFailedToReadEntity', $langs->trans("Order")) . '</div>';
setEventMessage($langs->trans('ErrorFailedToReadEntity', $langs->trans("Order")), 'errors');
dol_syslog($langs->trans('ErrorFailedToReadEntity', $langs->trans("Order")));
}
}
@ -1301,9 +1299,9 @@ if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->righ
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType") . '</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
} else {
$mesg = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -1350,8 +1348,6 @@ $formorder = new FormOrder($db);
if ($action == 'create' && $user->rights->commande->creer) {
print_fiche_titre($langs->trans('CreateOrder'));
dol_htmloutput_mesg($mesg, $mesgs, 'error');
$soc = new Societe($db);
if ($socid > 0)
$res = $soc->fetch($socid);
@ -1671,8 +1667,6 @@ if ($action == 'create' && $user->rights->commande->creer) {
$now = dol_now();
if ($object->id > 0) {
dol_htmloutput_mesg($mesg, $mesgs);
$product_static = new Product($db);
$soc = new Societe($db);

View File

@ -58,6 +58,8 @@ $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$viewstatut = GETPOST('viewstatut');
$error = 0;
if (! $sortfield) $sortfield='c.rowid';
if (! $sortorder) $sortorder='DESC';
@ -71,7 +73,8 @@ if ($action == 'create')
{
if (is_array($selected) == false)
{
$mesgs = array('<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>');
$error++;
setEventMessage($langs->trans('Error_OrderNotChecked'), 'errors');
}
else
{
@ -90,7 +93,7 @@ $hookmanager->initHooks(array('orderstoinvoice'));
* Actions
*/
if (($action == 'create' || $action == 'add') && empty($mesgs))
if (($action == 'create' || $action == 'add') && !$error)
{
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
@ -244,7 +247,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
}
else
{
$mesgs[]=$discount->error;
setEventMessage($discount->error, 'errors');
$error++;
break;
}
@ -313,7 +316,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
}
else
{
$mesgs[]=$objectsrc->error;
setEventMessage($objectsrc->error, 'errors');
$error++;
}
$ii++;
@ -321,7 +324,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
}
else
{
$mesgs[]=$object->error;
setEventMessage($object->error, 'errors');
$error++;
}
}
@ -341,7 +344,8 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$action='create';
$_GET["origin"]=$_POST["origin"];
$_GET["originid"]=$_POST["originid"];
$mesgs[]='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
$error++;
}
}
}
@ -357,7 +361,7 @@ $formfile = new FormFile($db);
$companystatic = new Societe($db);
// Mode creation
if ($action == 'create' && empty($mesgs))
if ($action == 'create' && !$error)
{
$facturestatic=new Facture($db);
@ -497,7 +501,7 @@ if ($action == 'create' && empty($mesgs))
//Mode liste
if (($action != 'create' && $action != 'add') || ! empty($mesgs))
if (($action != 'create' && $action != 'add') || !$error)
{
llxHeader();
?>
@ -693,7 +697,5 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
}
dol_htmloutput_mesg($mesg,$mesgs);
llxFooter();
$db->close();

View File

@ -72,8 +72,6 @@ if ($negpage)
if ($page > GETPOST("nbpage")) $page = GETPOST("nbpage");
}
$mesg='';
$object = new Account($db);
/*
@ -83,6 +81,8 @@ $dateop=-1;
if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banque->modifier)
{
$error = 0;
if (price2num($_POST["credit"]) > 0)
{
$amount = price2num($_POST["credit"]);
@ -98,11 +98,20 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu
$label=$_POST["label"];
$cat1=$_POST["cat1"];
if (! $dateop) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
if (! $operation) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
if (! $amount) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
if (! $dateop) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
}
if (! $operation) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Type")), 'errors');
}
if (! $amount) {
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
}
if (! $mesg)
if (! $error)
{
$object->fetch($id);
$insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
@ -114,7 +123,7 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
else
@ -295,8 +304,6 @@ if ($id > 0 || ! empty($ref))
print '<br>';
dol_htmloutput_errors($mesg);
/**
* Search form
*/

View File

@ -289,7 +289,7 @@ if ($result < 0)
{
$langs->load("errors");
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFailedToCreateDir").'</div>';
setEventMessage($langs->trans("ErrorFailedToCreateDir"), 'errors');
}
else
{

View File

@ -79,7 +79,7 @@ if ($action == 'update' && ! $_POST["cancel"])
}
else
{
$message='<div class="error">'.$account->error.'</div>';
setEventMessage($account->error, 'errors');
$action='edit'; // Force chargement page edition
}
}
@ -304,8 +304,6 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
print_fiche_titre($langs->trans("EditFinancialAccount"));
print "<br>";
dol_htmloutput_mesg($message);
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';

View File

@ -181,7 +181,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
}
else
{
$message='<div class="error">'.$account->error.'</div>';
setEventMessage($account->error, 'errors');
$action='edit'; // Force chargement page edition
}
}
@ -220,8 +220,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewFinancialAccount"));
dol_htmloutput_mesg($message);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
@ -510,8 +508,6 @@ else
print_fiche_titre($langs->trans("EditFinancialAccount"));
print "<br>";
if ($message) { print "$message<br>\n"; }
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';

View File

@ -46,7 +46,6 @@ $result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fie
$account=$_GET["account"];
$mode='standard';
if (isset($_GET["mode"]) && $_GET["mode"] == 'showalltime') $mode='showalltime';
$mesg = '';
$error=0;
@ -82,7 +81,7 @@ if ($result < 0)
{
$langs->load("errors");
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFailedToCreateDir").'</div>';
setEventMessage($langs->trans("ErrorFailedToCreateDir"), 'errors');
}
else
{
@ -756,8 +755,6 @@ else
$head=bank_prepare_head($acct);
dol_fiche_head($head,'graph',$langs->trans("FinancialAccount"),0,'account');
if ($mesg) print $mesg.'<br>';
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';

View File

@ -99,7 +99,7 @@ if ($user->rights->banque->modifier && $action == "update")
if ($ac->courant == 2 && $_POST['value'] != 'LIQ')
{
$mesg = '<div class="error">'.$langs->trans("ErrorCashAccountAcceptsOnlyCashMoney").'</div>';
setEventMessage($langs->trans("ErrorCashAccountAcceptsOnlyCashMoney"), 'errors');
$error++;
}
@ -141,7 +141,7 @@ if ($user->rights->banque->modifier && $action == "update")
$result = $db->query($sql);
if ($result)
{
$mesg=$langs->trans("RecordSaved");
setEventMessage($langs->trans("RecordSaved"));
$db->commit();
}
else
@ -161,7 +161,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action ==
// Check parameters
if ($rappro && empty($num_rel))
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountStatement"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountStatement")), 'errors');
$error++;
}
@ -179,7 +179,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action ==
$result = $db->query($sql);
if ($result)
{
$mesg=$langs->trans("RecordSaved");
setEventMessage($langs->trans("RecordSaved"));
$db->commit();
}
else
@ -235,8 +235,6 @@ $tabs = array(
dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'account');
dol_htmloutput_mesg($mesg);
$sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,";
$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account, b.fk_bordereau as receiptid,";
$sql.= " b.emetteur,b.banque";

View File

@ -69,7 +69,7 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
$result=$bankline->update_conciliation($user,$_POST["cat"]);
if ($result < 0)
{
$mesg.=$bankline->error;
setEventMessage($bankline->error, 'errors');
$error++;
break;
}
@ -81,7 +81,7 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
{
$error++;
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'</div>';
setEventMessage($langs->trans("ErrorPleaseTypeBankTransactionReportName"), 'errors');
}
if (! $error)
@ -183,8 +183,6 @@ if ($resql)
print_fiche_titre($langs->trans("Reconciliation").': <a href="account.php?account='.$acct->id.'">'.$acct->label.'</a>');
print '<br>';
dol_htmloutput_mesg($mesg);
// Show last bank receipts
$nbmax=5;
$liste="";

View File

@ -49,10 +49,6 @@ $result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fie
$vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"];
$page=isset($_GET["page"])?$_GET["page"]:0;
$mesg='';
/*
* View
*/
@ -115,10 +111,6 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
print '<br>';
if ($mesg) print '<div class="error">'.$mesg.'</div>';
$solde = $acct->solde(0);
/*

View File

@ -45,7 +45,6 @@ if ($action == 'add')
{
$langs->load("errors");
$mesg='';
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$label = GETPOST('label','alpha');
$amount= GETPOST('amount','int');
@ -53,22 +52,22 @@ if ($action == 'add')
if (! $label)
{
$error=1;
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("Description"))."</div>";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors');
}
if (! $amount)
{
$error=1;
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"))."</div>";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
}
if (! GETPOST('account_from','int'))
{
$error=1;
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferFrom"))."</div>";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferFrom")), 'errors');
}
if (! GETPOST('account_to','int'))
{
$error=1;
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo"))."</div>";
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo")), 'errors');
}
if (! $error)
{
@ -111,20 +110,19 @@ if ($action == 'add')
if (! $error)
{
$mesg.="<div class=\"ok\">";
$mesg.=$langs->trans("TransferFromToDone","<a href=\"account.php?account=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"account.php?account=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency));
$mesg.="</div>";
$mesgs = $langs->trans("TransferFromToDone","<a href=\"account.php?account=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"account.php?account=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency));
setEventMessage($mesgs);
$db->commit();
}
else
{
$mesg.="<div class=\"error\">".$accountfrom->error.' '.$accountto->error."</div>";
setEventMessage($accountfrom->error.' '.$accountto->error, 'errors');
$db->rollback();
}
}
else
{
$mesg.="<div class=\"error\">".$langs->trans("ErrorFromToAccountsMustDiffers")."</div>";
setEventMessage($langs->trans("ErrorFromToAccountsMustDiffers"), 'errors');
}
}
}
@ -154,8 +152,6 @@ if($error)
print_fiche_titre($langs->trans("BankTransfer"));
dol_htmloutput_mesg($mesg);
print $langs->trans("TransferDesc");
print "<br><br>";

View File

@ -44,8 +44,6 @@ $result = restrictedArea($user, 'deplacement', $id,'');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$mesg = '';
$object = new Deplacement($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@ -73,7 +71,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer)
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
}
@ -88,7 +86,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
@ -109,17 +107,17 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
if (! $object->date)
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
$error++;
}
if ($object->type == '-1') // Otherwise it is TF_LUNCH,...
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++;
}
if (! ($object->fk_user > 0))
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Person")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Person")), 'errors');
$error++;
}
@ -134,7 +132,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
$action='create';
}
}
@ -174,7 +172,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
else
@ -226,8 +224,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewTrip"));
dol_htmloutput_errors($mesg);
$datec = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
@ -299,8 +295,6 @@ else if ($id)
$result = $object->fetch($id);
if ($result > 0)
{
dol_htmloutput_mesg($mesg);
$head = trip_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');

View File

@ -43,9 +43,6 @@ $action=GETPOST('action','alpha');
$cancel=GETPOST('cancel');
$amount=GETPOST('amount');
$mesg="";
$mesgs=array();
$don = new Don($db);
$donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
@ -72,14 +69,14 @@ if ($action == 'update')
if (empty($donation_date))
{
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
$action = "create";
$error++;
}
if (empty($amount))
{
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
$setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
$action = "create";
$error++;
}
@ -125,14 +122,14 @@ if ($action == 'add')
if (empty($donation_date))
{
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
$action = "create";
$error++;
}
if (empty($amount))
{
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
$action = "create";
$error++;
}
@ -182,7 +179,9 @@ if ($action == 'valid_promesse')
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else $mesg=$don->error;
else {
setEventMessage($don->error, 'errors');
}
}
if ($action == 'set_cancel')
{
@ -191,7 +190,9 @@ if ($action == 'set_cancel')
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else $mesg=$don->error;
else {
setEventMessage($don->error, 'errors');
}
}
if ($action == 'set_paid')
{
@ -200,7 +201,9 @@ if ($action == 'set_paid')
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else $mesg=$don->error;
else {
setEventMessage($don->error, 'errors');
}
}
if ($action == 'set_encaisse')
{
@ -209,7 +212,9 @@ if ($action == 'set_encaisse')
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else $mesg=$don->error;
else {
setEventMessage($don->error, 'errors');
}
}
/*
@ -263,8 +268,6 @@ if ($action == 'create')
{
print_fiche_titre($langs->trans("AddDonation"));
dol_htmloutput_errors($mesg,$mesgs);
print '<form name="add" action="fiche.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';

View File

@ -115,9 +115,9 @@ include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->creer) {
if (1 == 0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"])) {
$mesgs [] = '<div class="error">' . $langs->trans("NoCloneOptionsSpecified") . '</div>';
} else {
// if (1 == 0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"])) {
// $mesgs [] = '<div class="error">' . $langs->trans("NoCloneOptionsSpecified") . '</div>';
// } else {
if ($object->fetch($id) > 0) {
$result = $object->createFromClone($socid);
if ($result > 0) {
@ -128,7 +128,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->c
$action = '';
}
}
}
// }
}
// Change status of invoice
@ -216,13 +216,13 @@ else if ($action == 'valid' && $user->rights->facture->creer) {
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
// Si avoir, le signe doit etre negatif
if ($object->total_ht >= 0) {
$mesgs [] = '<div class="error">' . $langs->trans("ErrorInvoiceAvoirMustBeNegative") . '</div>';
setEventMessage($langs->trans("ErrorInvoiceAvoirMustBeNegative"), 'errors');
$action = '';
}
} else {
// Si non avoir, le signe doit etre positif
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) {
$mesgs [] = '<div class="error">' . $langs->trans("ErrorInvoiceOfThisTypeMustBePositive") . '</div>';
setEventMessage($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), 'errors');
$action = '';
}
}
@ -319,7 +319,7 @@ else if ($action == "setabsolutediscount" && $user->rights->facture->creer) {
if ($ret > 0) {
$result = $object->insert_discount($_POST["remise_id"]);
if ($result < 0) {
$mesgs [] = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
} else {
dol_print_error($db, $object->error);
@ -332,7 +332,7 @@ else if ($action == "setabsolutediscount" && $user->rights->facture->creer) {
$result = $discount->link_to_invoice(0, $id);
if ($result < 0) {
$mesgs [] = '<div class="error">' . $discount->error . '</div>';
setEventMessage($discount->error, 'errors');
}
}
}
@ -571,7 +571,6 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
$result = $object->set_paid($user);
if ($result >= 0)
{
//$mesgs[]='OK'.$discount->id;
$db->commit();
}
else
@ -642,8 +641,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
$object->type = Facture::TYPE_REPLACEMENT;
$id = $object->createFromCurrent($user);
if ($id <= 0)
$mesgs [] = $object->error;
if ($id <= 0) {
setEventMessage($object->error, 'errors');
}
}
}
@ -888,7 +888,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$amountdeposit = ($totalamount * $valuedeposit) / 100;
}
} else {
$mesgs [] = $srcobject->error;
setEventMessage($srcobject->error, 'errors');
$error ++;
}
}
@ -955,7 +955,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
if ($discountid > 0) {
$result = $object->insert_discount($discountid); // This include link_to_invoice
} else {
$mesgs [] = $discount->error;
setEventMessage($discount->error, 'errors');
$error ++;
break;
}
@ -1016,12 +1016,12 @@ else if ($action == 'add' && $user->rights->facture->creer)
if ($reshook < 0)
$error ++;
} else {
$mesgs [] = $srcobject->error;
setEventMessage($srcobject->error, 'errors');
$error ++;
}
}
} else {
$mesgs [] = $object->error;
setEventMessage($object->error, 'errors');
$error ++;
}
} // If some invoice's lines already known
@ -1054,7 +1054,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$action = 'create';
$_GET ["origin"] = $_POST["origin"];
$_GET ["originid"] = $_POST["originid"];
$mesgs [] = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
}
@ -1606,7 +1606,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1);
if ($mailfile->error) {
$mesgs [] = '<div class="error">' . $mailfile->error . '</div>';
setEventMessage($mailfile->error, 'errors');
} else {
$result = $mailfile->sendfile();
if ($result) {
@ -1642,15 +1642,15 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
} else {
$langs->load("other");
$mesg = '<div class="error">';
if ($mailfile->error) {
$mesg .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
$mesg .= '<br>' . $mailfile->error;
} else {
$mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg .= '</div>';
$mesgs [] = $mesg;
setEventMessage($mesg, 'errors');
}
}
/* }
@ -1662,12 +1662,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}*/
} else {
$langs->load("errors");
$mesgs [] = '<div class="error">' . $langs->trans('ErrorCantReadFile', $file) . '</div>';
setEventMessage($langs->trans('ErrorCantReadFile', $file), 'errors');
dol_syslog('Failed to read file: ' . $file);
}
} else {
$langs->load("other");
$mesgs [] = '<div class="error">' . $langs->trans('ErrorFailedToReadEntity', $langs->trans("Invoice")) . '</div>';
setEventMessage($langs->trans('ErrorFailedToReadEntity', $langs->trans("Invoice")), 'errors');
dol_syslog('Impossible de lire les donnees de la facture. Le fichier facture n\'a peut-etre pas ete genere.');
}
@ -1749,9 +1749,9 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture-
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesgs [] = '<div class="error">' . $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType") . '</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
} else {
$mesgs [] = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -3764,7 +3764,5 @@ if ($action == 'create')
}
}
dol_htmloutput_mesg('', $mesgs);
llxFooter();
$db->close();

View File

@ -127,7 +127,6 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

View File

@ -453,8 +453,6 @@ if ($resql)
print_fiche_titre($titre,$link);
//print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page
dol_htmloutput_mesg($mesg);
print '<form id="form_unpaid" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
if (! empty($mode) && $action == 'presend')

View File

@ -47,8 +47,6 @@ $fieldname = (! empty($ref)?'number':'rowid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldname);
$mesg='';
$sortfield=GETPOST('sortfield', 'alpha');
$sortorder=GETPOST('sortorder', 'alpha');
$page=GETPOST('page', 'int');
@ -122,12 +120,12 @@ if ($action == 'setref' && $user->rights->banque->cheque)
$result=$object->set_number($user,$number);
if ($result < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
@ -337,9 +335,6 @@ else
}
}
dol_htmloutput_errors($mesg);
$accounts = array();
if ($action == 'new')

View File

@ -45,8 +45,6 @@ if ($user->societe_id) $socid=$user->societe_id;
// TODO ajouter regle pour restreindre acces paiement
//$result = restrictedArea($user, 'facture', $id,'');
$mesg='';
$object = new Paiement($db);
@ -67,7 +65,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@ -87,7 +85,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
setEventMessage($langs->trans($object->error), 'errors');
$db->rollback();
}
}
@ -123,7 +121,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
setEventMessage($langs->trans($object->error), 'errors');
$db->rollback();
}
}
@ -134,11 +132,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']);
if ($res === 0)
{
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
}
else
{
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
}
}
@ -149,11 +147,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
$res = $object->update_date($datepaye);
if ($res === 0)
{
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
}
else
{
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
}
}
@ -198,10 +196,6 @@ if ($action == 'valide')
}
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
// Ref

View File

@ -104,8 +104,6 @@ if ($result)
print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
dol_htmloutput_mesg($mesg);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="noborder" width="100%">';

View File

@ -69,7 +69,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
}
else
{
$mesg='<div class="error">'.$chargesociales->error.'</div>';
setEventMessage($chargesociales->error, 'errors');
}
}
@ -81,22 +81,22 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
$dateperiod=@dol_mktime($_POST["periodhour"],$_POST["periodmin"],$_POST["periodsec"],$_POST["periodmonth"],$_POST["periodday"],$_POST["periodyear"]);
if (! $dateech)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
$action = 'create';
}
elseif (! $dateperiod)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors');
$action = 'create';
}
elseif (! $_POST["actioncode"] > 0)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors');
$action = 'create';
}
elseif (! $_POST["amount"])
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
$action = 'create';
}
else
@ -110,13 +110,9 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
$chargesociales->amount=$_POST["amount"];
$id=$chargesociales->create($user);
if ($id > 0)
if ($id <= 0)
{
//$mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>';
}
else
{
$mesg='<div class="error">'.$chargesociales->error.'</div>';
setEventMessage($chargesociales->error, 'errors');
}
}
}
@ -128,12 +124,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
$dateperiod=dol_mktime($_POST["periodhour"],$_POST["periodmin"],$_POST["periodsec"],$_POST["periodmonth"],$_POST["periodday"],$_POST["periodyear"]);
if (! $dateech)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
$action = 'edit';
}
elseif (! $dateperiod)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors');
$action = 'edit';
}
else
@ -146,13 +142,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
$chargesociales->periode=$dateperiod;
$result=$chargesociales->update($user);
if ($result > 0)
if ($result <= 0)
{
//$mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>';
}
else
{
$mesg='<div class="error">'.$chargesociales->error.'</div>';
setEventMessage($chargesociales->error, 'errors');
}
}
}
@ -176,8 +168,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewSocialContribution"));
print "<br>\n";
dol_htmloutput_mesg($mesg);
$var=false;
print '<form name="charge" method="post" action="'.$_SERVER["PHP_SELF"].'">';
@ -246,8 +236,6 @@ if ($id > 0)
if ($result > 0)
{
dol_htmloutput_mesg($mesg);
$head=tax_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');

View File

@ -127,10 +127,6 @@ if ($resql)
print_barre_liste($langs->trans("SocialContributions"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
}
dol_htmloutput_mesg($mesg);
if (empty($mysoc->country_id) && empty($mysoc->country_code))
{
print '<div class="error">';

View File

@ -102,8 +102,6 @@ if ($result)
print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
dol_htmloutput_mesg($mesg);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="noborder" width="100%">';

View File

@ -49,8 +49,6 @@ $contact->fetch($id, $user);
if ($action == 'dolibarr2ldap')
{
$message="";
$db->begin();
$ldap=new Ldap();
@ -64,12 +62,12 @@ if ($action == 'dolibarr2ldap')
if ($result >= 0)
{
$message.='<div class="ok">'.$langs->trans("ContactSynchronized").'</div>';
setEventMessage($langs->trans("ContactSynchronized"));
$db->commit();
}
else
{
$message.='<div class="error">'.$ldap->error.'</div>';
setEventMessage($ldap->error, 'errors');
$db->rollback();
}
}
@ -136,10 +134,6 @@ print '</table>';
print '</div>';
dol_htmloutput_mesg($message);
/*
* Barre d'actions
*/

View File

@ -67,15 +67,14 @@ if ($action == 'addcontact' && $user->rights->contrat->creer)
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
$msg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
} else {
$mesg = $object->error;
}
setEventMessage($mesg, 'errors');
}
}
@ -117,8 +116,6 @@ $formcompany= new FormCompany($db);
$contactstatic=new Contact($db);
$userstatic=new User($db);
dol_htmloutput_mesg($mesg);
/* *************************************************************************** */
/* */
/* Mode vue et edition */
@ -129,8 +126,6 @@ if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id, $ref) > 0)
{
dol_htmloutput_mesg($mesg);
$object->fetch_thirdparty();
$head = contract_prepare_head($object);

View File

@ -64,8 +64,6 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
dol_htmloutput_mesg($mesg);
$object->fetch_thirdparty();
$head = contract_prepare_head($object);

View File

@ -137,8 +137,6 @@ class mailing_xinputfile extends MailingTargets
{
$cpt=0;
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES);
$file=$upload_dir . "/" . $_FILES['username']['name'];
$handle = @fopen($file, "r");
if ($handle)

View File

@ -269,7 +269,7 @@ if ($action == 'execute'){
if (empty($object->status) && $action != 'create')
{
dol_htmloutput_mesg($langs->trans("CronTaskInactive"),'','warning',1);
setEventMessage($langs->trans("CronTaskInactive"), 'warnings');
}
if (($action=="create") || ($action=="edit"))

View File

@ -110,8 +110,6 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else
@ -134,7 +132,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
else
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
}
}
}
@ -156,7 +154,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
}
else
{
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
$action = "create";
}
@ -198,7 +196,7 @@ if ($action == 'confirm_deletefile')
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
{
$result=$ecmdir->delete($user);
$mesg = '<div class="ok">'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'</div>';
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
clearstatcache();
}
@ -324,7 +322,6 @@ if ($action == 'refreshmanual')
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
if (! dol_is_dir($dirtotest))
{
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
$ecmdirtmp->id=$dirdesc['id'];
$ecmdirtmp->delete($user,'databaseonly');
//exit;
@ -440,9 +437,6 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax))
}
dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
else $classviewhide='visible';

View File

@ -110,8 +110,6 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else
@ -134,7 +132,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
else
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
}
}
}
@ -156,7 +154,8 @@ if ($action == 'add' && $user->rights->ecm->setup)
}
else
{
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
//TODO: Translate
setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
$action = "create";
}
@ -198,7 +197,7 @@ if ($action == 'confirm_deletefile')
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
{
$result=$ecmdir->delete($user);
$mesg = '<div class="ok">'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'</div>';
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
clearstatcache();
}
@ -324,7 +323,6 @@ if ($action == 'refreshmanual')
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
if (! dol_is_dir($dirtotest))
{
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
$ecmdirtmp->id=$dirdesc['id'];
$ecmdirtmp->delete($user,'databaseonly');
//exit;
@ -436,9 +434,6 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax))
}
dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
else $classviewhide='visible';

View File

@ -87,15 +87,14 @@ if ($action == 'addcontact' && $user->rights->expedition->creer)
}
else
{
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$objectsrc->error.'</div>';
$mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
} else {
$mesg = $objectsrc->error;
}
setEventMessage($mesg, 'errors');
}
}
@ -146,7 +145,6 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

View File

@ -166,6 +166,8 @@ if ($action=='selectfield')
}
//print_r($array_selected);
$_SESSION["export_selected_fields"]=$array_selected;
setEventMessage($warnings, 'warnings');
}
}
@ -488,9 +490,6 @@ if ($step == 2 && $datatoexport)
print '</table>';
print '<br>';
if ($warnings) dol_htmloutput_mesg('',$warnings,'warning');
// Combo list of export models
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -59,12 +59,12 @@ if ($action == 'update')
if ($i >= 2)
{
$db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
$mesg="<div class=\"error\">".$db->lasterror()."</div>";
setEventMessage($db->lasterror(), 'errors');
}
}
@ -120,10 +120,6 @@ print "</center>";
print "</form>\n";
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -64,15 +64,14 @@ if ($action == 'addcontact' && $user->rights->ficheinter->creer)
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
$mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
} else {
$mesg = $object->error;
}
setEventMessage($mesg, 'errors');
}
}
@ -109,9 +108,7 @@ $userstatic=new User($db);
llxHeader();
// Mode vue et edition
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

View File

@ -1117,7 +1117,7 @@ else if ($id > 0 || ! empty($ref))
if (empty($numref))
{
$error++;
dol_htmloutput_errors($object->error);
setEventMessage($object->error, 'errors');
}
}
else

View File

@ -60,8 +60,6 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
dol_htmloutput_mesg($mesg);
$societe = new Societe($db);
if ($societe->fetch($object->socid))
{

View File

@ -69,11 +69,11 @@ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -126,7 +126,6 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

View File

@ -641,7 +641,7 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Delivery")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Delivery")), 'errors');
}
}
@ -770,7 +770,7 @@ else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
if ($socid <1)
{
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')), 'errors');
$action='create';
$error++;
}
@ -801,7 +801,7 @@ else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{
$langs->load("errors");
$db->rollback();
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
setEventMessage($langs->trans($object->error), 'errors');
$action='create';
$_GET['socid']=$_POST['socid'];
}
@ -1073,7 +1073,6 @@ if ($action=="create")
{
print_fiche_titre($langs->trans('NewOrder'));
dol_htmloutput_mesg($mesg);
dol_htmloutput_events();
$societe='';

View File

@ -69,11 +69,11 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -125,7 +125,6 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

View File

@ -52,8 +52,6 @@ $langs->load('companies');
$langs->load('products');
$langs->load('banks');
$mesg='';
$errors=array();
$id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int'));
$action = GETPOST("action");
$confirm = GETPOST("confirm");
@ -92,12 +90,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (1==0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
}
else
{
// if (1==0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
// {
// $mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
// }
// else
// {
$result=$object->createFromClone($id);
if ($result > 0)
{
@ -107,10 +105,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
setEventMessage($langs->trans($object->error), 'errors');
$action='';
}
}
// }
}
elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider)
@ -137,7 +135,7 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni
if (! $idwarehouse || $idwarehouse == -1)
{
$error++;
$errors[]=$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse"));
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors');
$action='';
}
}
@ -165,7 +163,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fourn
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
@ -180,7 +178,7 @@ elseif ($action == 'confirm_delete_line' && $confirm == 'yes' && $user->rights->
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
/* Fix bug 1485 : Reset action to avoid asking again confirmation on failure */
$action='';
}
@ -258,7 +256,9 @@ elseif ($action == 'deletepaiement' && $user->rights->fournisseur->facture->cree
$paiementfourn = new PaiementFourn($db);
$result=$paiementfourn->fetch(GETPOST('paiement_id'));
if ($result > 0) $result=$paiementfourn->delete(); // If fetch ok and found
if ($result < 0) $mesg='<div class="error">'.$paiementfourn->error.'</div>';
if ($result < 0) {
setEventMessage($paiementfourn->error, 'errors');
}
}
}
@ -272,21 +272,21 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
if (GETPOST('socid','int')<1)
{
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')), 'errors');
$action='create';
$error++;
}
if ($datefacture == '')
{
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')), 'errors');
$action='create';
$_GET['socid']=$_POST['socid'];
$error++;
}
if (! GETPOST('ref_supplier'))
{
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('RefSupplier')).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('RefSupplier')), 'errors');
$action='create';
$_GET['socid']=$_POST['socid'];
$error++;
@ -457,7 +457,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
{
$langs->load("errors");
$db->rollback();
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
setEventMessage($langs->trans($object->error), 'errors');
$action='create';
$_GET['socid']=$_POST['socid'];
}
@ -631,14 +631,14 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
// Product not selected
$error++;
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")), 'errors');
}
if ($idprod == -1)
{
// Quantity too low
$error++;
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorQtyTooLowForThisSupplier").'</div>';
setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors');
}
}
else if( GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='' )
@ -732,10 +732,7 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
else
{
$db->rollback();
if (empty($mesg))
{
$mesg='<div class="error">'.$object->error.'</div>';
}
setEventMessage($object->error, 'errors');
}
$action = '';
@ -798,7 +795,7 @@ elseif ($action == 'reopen' && $user->rights->fournisseur->facture->creer)
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -948,7 +945,6 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
else
{
$langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
@ -958,7 +954,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
{
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg.='</div>';
setEventMessage($mesg, 'errors');
}
}
}
@ -966,7 +962,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').'</div>';
setEventMessage($langs->trans('ErrorMailRecipientIsEmpty'), 'errors');
dol_syslog('Recipient email is empty');
}
/* }
@ -980,7 +976,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorFailedToReadEntity',$langs->trans("Invoice")).'</div>';
setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Invoice")), 'errors');
dol_syslog('Unable to read data from the invoice. The invoice file has perhaps not been generated.');
}
@ -1064,11 +1060,11 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fourniss
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -1119,7 +1115,6 @@ if ($action == 'create')
{
print_fiche_titre($langs->trans('NewBill'));
dol_htmloutput_mesg($mesg);
dol_htmloutput_events();
$societe='';
@ -1146,7 +1141,6 @@ if ($action == 'create')
$element = $subelement = 'commande';
}
if ($element == 'propal') {
dol_htmloutput_errors('',$errors);
$element = 'comm/propal'; $subelement = 'propal';
}
if ($element == 'contract') {
@ -1479,9 +1473,6 @@ else
dol_fiche_head($head, 'card', $titre, 0, 'bill');
dol_htmloutput_mesg($mesg);
dol_htmloutput_errors('',$errors);
// Confirmation de la suppression d'une ligne produit
if ($action == 'confirm_delete_line')
{

View File

@ -503,9 +503,6 @@ if (empty($action))
print_barre_liste($langs->trans('SupplierPayments'), $page, 'paiement.php',$paramlist,$sortfield,$sortorder,'',$num);
if ($mesg) dol_htmloutput_mesg($mesg);
if ($errmsg) dol_htmloutput_errors($errmsg);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -36,8 +36,6 @@ $langs->load('banks');
$langs->load('companies');
$langs->load("suppliers");
$mesg='';
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
@ -61,7 +59,7 @@ if ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@ -80,7 +78,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@ -98,7 +96,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisse
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
@ -109,11 +107,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']);
if ($res === 0)
{
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
$setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
}
else
{
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
}
}
@ -124,11 +122,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
$res = $object->update_date($datepaye);
if ($res === 0)
{
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
}
else
{
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
}
}
@ -229,8 +227,6 @@ if ($result > 0)
print '</table>';
dol_htmloutput_mesg($mesg);
print '<br>';
/**

View File

@ -58,18 +58,17 @@ if ($action == 'add' || GETPOST('modify','alpha'))
$ftp_server = "FTP_SERVER_" . $entry; //$_POST["numero_entry"];
$error=0;
$mesg='';
if (! GETPOST("$ftp_name",'alpha'))
{
$error=1;
$mesg.='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors');
}
if (! GETPOST("$ftp_server",'alpha'))
{
$error=1;
$mesg.='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")), 'errors');
}
if (! $error)
@ -91,7 +90,6 @@ if ($action == 'add' || GETPOST('modify','alpha'))
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
{
$db->commit();
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@ -119,7 +117,6 @@ if (GETPOST('delete','alpha'))
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
{
$db->commit();
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@ -301,9 +298,6 @@ else
}
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -100,8 +100,6 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0);
if (is_numeric($resupload) && $resupload > 0)
{
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else {
@ -124,7 +122,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
// Echec transfert (fichier depassant la limite ?)
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
}
}
@ -143,7 +141,8 @@ if ($_POST["action"] == 'add' && $user->rights->ftp->setup)
}
else
{
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
//TODO: Translate
setEventMessage('Error '.$langs->trans($ecmdir->error));
$_GET["action"] = "create";
}
}
@ -175,12 +174,12 @@ if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes'
$result=@ftp_delete($conn_id, $newremotefileiso);
if ($result)
{
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",$file).'</div>';
setEventMessage($langs->trans("FileWasRemoved",$file));
}
else
{
dol_syslog("ftp/index.php ftp_delete", LOG_ERR);
$mesg = '<div class="error">'.$langs->trans("FTPFailedToRemoveFile",$file).'</div>';
setEventMessage($langs->trans("FTPFailedToRemoveFile",$file), 'errors');
}
//ftp_close($conn_id); Close later
@ -225,12 +224,12 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De
$result=@ftp_delete($conn_id, $newremotefileiso);
if ($result)
{
$mesg .= '<div class="ok">'.$langs->trans("FileWasRemoved",$file).'</div>';
setEventMessage($langs->trans("FileWasRemoved",$file));
}
else
{
dol_syslog("ftp/index.php ftp_delete", LOG_ERR);
$mesg .= '<div class="error">'.$langs->trans("FTPFailedToRemoveFile",$file).'</div>';
setEventMessage($langs->trans("FTPFailedToRemoveFile",$file), 'errors');
}
//ftp_close($conn_id); Close later
@ -269,11 +268,11 @@ if ($_REQUEST['action'] == 'confirm_deletesection' && $_REQUEST['confirm'] == 'y
$result=@ftp_rmdir($conn_id, $newremotefileiso);
if ($result)
{
$mesg = '<div class="ok">'.$langs->trans("DirWasRemoved",$file).'</div>';
setEventMessage($langs->trans("DirWasRemoved",$file));
}
else
{
$mesg = '<div class="error">'.$langs->trans("FTPFailedToRemoveDir",$file).'</div>';
setEventMessage($langs->trans("FTPFailedToRemoveDir",$file), 'errors');
}
//ftp_close($conn_id); Close later
@ -340,7 +339,8 @@ if ($_REQUEST['action'] == 'download')
}
else
{
$mesg='<div class="error">Failed to get file '.$remotefile.'</div>';
//TODO: Translate
setEventMessage('Failed to get file '.$remotefile, 'errors');
}
}
@ -444,9 +444,6 @@ else
print '<br>';
print "<br>\n";
if ($mesg) { print $mesg."<br>"; }
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="numero_ftp" value="'.$numero_ftp.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -596,9 +593,6 @@ else
print "</table>";
if (! $ok && $mesg) print $mesg;
// Actions
/*
if ($user->rights->ftp->write && ! empty($section))

View File

@ -59,7 +59,6 @@ $cp = new Holiday($db);
// Contrôle du formulaire
if ($action == "add")
{
$message = '';
$error = 0;
// Option du groupe de validation
@ -142,9 +141,9 @@ if ($action == "add")
if ($error)
{
$message = '<div class="error">'.$langs->trans('ErrorUpdateConfCP').'</div>';
setEventMessage($langs->trans('ErrorUpdateConfCP'), 'errors');
} else {
$message = '<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
setEventMessage($langs->trans('UpdateConfCPOK'));
}
// Si première mise à jour, prévenir l'utilisateur de mettre à jour le solde des congés payés
@ -156,12 +155,9 @@ if ($action == "add")
if($num < 1)
{
$cp->createCPusers();
$message.= '<br /><div class="warning">'.$langs->trans('AddCPforUsers').'</div>';
setEventMessage($langs->trans('AddCPforUsers'), 'warnings');
}
dol_htmloutput_mesg($message);
// Si il s'agit de créer un event
}
elseif ($action == 'create_event')
@ -173,12 +169,12 @@ elseif ($action == 'create_event')
if (! $optName)
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors');
$error++;
}
if (! $optValue > 0)
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")), 'errors');
$error++;
}
@ -190,17 +186,15 @@ elseif ($action == 'create_event')
$result = $cp->createEventCP($user);
if($result > 0)
{
$message = 'OkCreateEventCP';
setEventMessage('OkCreateEventCP');
$optName='';
$optValue='';
}
else
{
$message = '<div class="error">'.$cp->error.'</div>';
setEventMessage($cp->error, 'errors');
}
}
dol_htmloutput_mesg($message);
}
elseif($action == 'event' && isset($_POST['update_event']))
{
@ -234,15 +228,13 @@ elseif($action == 'event' && isset($_POST['update_event']))
// Mise à jour des congés de l'utilisateur
$update = $cp->updateEventCP($eventId,$eventName,$eventValue);
if(!$update) {
$message='ErrorUpdateEventCP';
setEventMessage('ErrorUpdateEventCP', 'errors');
} else {
$message='UpdateEventOkCP';
setEventMessage('UpdateEventOkCP');
}
} else {
$message='ErrorUpdateEventCP';
setEventMessage('ErrorUpdateEventCP', 'errors');
}
dol_htmloutput_mesg($message);
}
elseif($action && isset($_POST['delete_event']))
{

View File

@ -84,10 +84,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
dol_syslog('define_holiday update lastUpdate entry', LOG_DEBUG);
$result = $db->query($sql);
$mesg='<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
dol_htmloutput_mesg($mesg);
setEventMessage($langs->trans('UpdateConfCPOK'));
}
elseif($action == 'add_event')
{
@ -105,7 +102,7 @@ elseif($action == 'add_event')
if ($error)
{
$message = '<div class="error">'.$langs->trans('ErrorAddEventToUserCP').'</div>';
setEventMessage($langs->trans('ErrorAddEventToUserCP'), 'errors');
}
else
{
@ -118,10 +115,8 @@ elseif($action == 'add_event')
$holiday->updateSoldeCP($userCP,$new_holiday);
$message = $langs->trans('AddEventToUserOkCP');
setEventMessage($langs->trans('AddEventToUserOkCP'));
}
dol_htmloutput_mesg($message);
}
$langs->load('users');

View File

@ -705,7 +705,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
break;
}
dol_htmloutput_mesg('',$errors,'error');
setEventMessage($errors, 'errors');
}
@ -890,7 +890,7 @@ else
break;
}
dol_htmloutput_mesg('',$errors,'error');
setEventMessage($errors, 'errors');
}
// On vérifie si l'utilisateur à le droit de lire cette demande

View File

@ -138,11 +138,11 @@ if ($action == 'builddoc')
$result=$objimport->build_file($user, GETPOST('model','alpha'), $datatoimport, $array_match_file_to_database);
if ($result < 0)
{
$mesg='<div class="error">'.$objimport->error.'</div>';
setEventMessage($objimport->error, 'errors');
}
else
{
$mesg='<div class="ok">'.$langs->trans("FileSuccessfullyBuilt").'</div>';
setEventMessage($langs->trans("FileSuccessfullyBuilt"));
}
}
@ -175,21 +175,23 @@ if ($action == 'add_import_model')
$result = $objimport->create($user);
if ($result >= 0)
{
$mesg='<div class="ok">'.$langs->trans("ImportModelSaved",$objimport->model_name).'</div>';
setEventMessage($langs->trans("ImportModelSaved",$objimport->model_name));
}
else
{
$langs->load("errors");
if ($objimport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$mesg='<div class="error">'.$langs->trans("ErrorImportDuplicateProfil").'</div>';
setEventMessage($langs->trans("ErrorImportDuplicateProfil"), 'errors');
}
else {
setEventMessage($objimport->error, 'errors');
}
else $mesg='<div class="error">'.$objimport->error.'</div>';
}
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")), 'errors');
}
}
@ -385,8 +387,6 @@ if ($step == 1 || ! $datatoimport)
dol_fiche_end();
if ($mesg) print $mesg;
}
@ -461,7 +461,6 @@ if ($step == 2 && $datatoimport)
dol_fiche_end();
if ($mesg) print $mesg;
}
@ -597,10 +596,7 @@ if ($step == 3 && $datatoimport)
print '</table></form>';
dol_fiche_end();
if ($mesg) print $mesg;
}
@ -1010,9 +1006,6 @@ if ($step == 4 && $datatoimport)
print '</script>'."\n";
}
if ($mesg) print $mesg;
/*
* Barre d'action
*/
@ -1438,8 +1431,6 @@ if ($step == 5 && $datatoimport)
}
print '</center>';
}
if ($mesg) print $mesg;
}
@ -1679,8 +1670,6 @@ if ($step == 6 && $datatoimport)
print $langs->trans("FileWasImported",$importid).'<br>';
print $langs->trans("YouCanUseImportIdToFindRecord",$importid).'<br>';
print '</center>';
if ($mesg) print $mesg;
}

View File

@ -67,7 +67,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
setEventMessage($langs->trans("SetupSaved"));
}
else
{
@ -227,8 +227,6 @@ if (! empty($conf->adherent->enabled))
print "<br>";
print info_admin($langs->trans("YouCanAddTagOnUrl"));
dol_htmloutput_mesg($mesg);
$db->close();
dol_fiche_end();
llxFooter();

View File

@ -91,12 +91,12 @@ if ($action == 'setModuleOptions')
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');
}
}
@ -178,11 +178,11 @@ if($action)
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');
}
}
@ -505,14 +505,13 @@ if (! empty($conf->global->PRODUCT_CANVAS_ABILITY))
}
else
{
//TODO: Translate
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
}
print '</table>';
}
dol_htmloutput_mesg($mesg);
llxFooter();
$db->close();

View File

@ -89,8 +89,6 @@ dol_fiche_head($head, 'attributes', $tab, 0, 'product');
print $langs->trans('DefineHereComplementaryAttributes', $tab).'<br>'."\n";
print '<br>';
dol_htmloutput_errors($mesg);
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);

View File

@ -49,8 +49,6 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
$mesg = '';
$product = new Product($db);
$productid=0;
if ($id > 0 || ! empty($ref))
@ -83,8 +81,11 @@ $cancel <> $langs->trans("Cancel") &&
{
$error++;
$action = 're-edit';
if ($product->error == "isFatherOfThis") $mesg = $langs->trans("ErrorAssociationIsFatherOfThis");
else $mesg=$product->error;
if ($product->error == "isFatherOfThis") {
setEventMessage($langs->trans("ErrorAssociationIsFatherOfThis"), 'errors');
} else {
setEventMessage($product->error, 'errors');
}
}
}
else
@ -97,7 +98,7 @@ $cancel <> $langs->trans("Cancel") &&
{
$error++;
$action = 're-edit';
$mesg=$product->error;
setEventMessage($product->error, 'errors');
}
}
}
@ -161,10 +162,6 @@ if ($action == 'search')
llxHeader("","",$langs->trans("CardProduct".$product->type));
dol_htmloutput_errors($mesg);
$head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type);
$picto=($product->type==1?'service':'product');

View File

@ -43,7 +43,7 @@ $rowid=GETPOST('rowid','int');
$action=GETPOST('action', 'alpha');
$socid=GETPOST('socid', 'int');
$backtopage=GETPOST('backtopage','alpha');
$error=0; $mesg = '';
$error=0;
// If socid provided by ajax company selector
if (! empty($_REQUEST['search_fourn_id']))
@ -92,7 +92,7 @@ if ($action == 'remove_pf')
{
$result=$product->remove_product_fournisseur_price($rowid);
$action = '';
$mesg = '<div class="ok">'.$langs->trans("PriceRemoved").'.</div>';
setEventMessage($langs->trans("PriceRemoved"));
}
}
}
@ -112,27 +112,27 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
if ($tva_tx == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors');
}
if (empty($quantity))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors');
}
if (empty($ref_fourn))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors');
}
if ($id_fourn <= 0)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors');
}
if ($_POST["price"] < 0 || $_POST["price"] == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors');
}
$product = new ProductFournisseur($db);
@ -140,7 +140,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
if ($result <= 0)
{
$error++;
$mesg=$product->error;
setEventMessage($product->error, 'errors');
}
if (! $error)
@ -157,12 +157,12 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
$product->fetch($product->product_id_already_linked);
$productLink = $product->getNomUrl(1,'supplier');
$mesg='<div class="error">'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'</div>';
setEventMessage($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), 'errors');
}
else if ($ret < 0)
{
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
setEventMessage($product->error, 'errors');
}
}
@ -177,7 +177,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
if ($ret < 0)
{
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
setEventMessage($product->error, 'errors');
}
}
@ -264,10 +264,6 @@ if ($id || $ref)
print "</div>\n";
dol_htmloutput_mesg($mesg);
// Form to add or update a price
if (($action == 'add_price' || $action == 'updateprice' ) && ($user->rights->produit->creer || $user->rights->service->creer))
{

View File

@ -230,7 +230,9 @@ else
llxHeader('',$title,$helpurl,'');
// Displays product removal confirmation
if (GETPOST('delprod')) dol_htmloutput_mesg($langs->trans("ProductDeleted",GETPOST('delprod')));
if (GETPOST('delprod')) {
setEventMessage($langs->trans("ProductDeleted", GETPOST('delprod')));
}
$param="&amp;sref=".$sref.($sbarcode?"&amp;sbarcode=".$sbarcode:"")."&amp;snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy;
$param.=($fourn_id?"&amp;fourn_id=".$fourn_id:"");

View File

@ -94,15 +94,16 @@ if ($action == 'update_price' && ! $_POST ["cancel"] && ($user->rights->produit-
if ($object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq) > 0) {
$action = '';
$mesg = '<div class="ok">' . $langs->trans("RecordSaved") . '</div>';
setEventMessage($langs->trans("RecordSaved"));
} else {
$action = 'edit_price';
$mesg = '<div class="error">' . $object->error . '</div>';
setEventMessage($object->error, 'errors');
}
} else if ($action == 'delete' && $user->rights->produit->supprimer) {
$result = $object->log_price_delete($user, $_GET ["lineid"]);
if ($result < 0)
$mesg = '<div class="error">' . $object->error . '</div>';
if ($result < 0) {
setEventMessage($object->error, 'errors');
}
}
/**
@ -136,11 +137,11 @@ if ($action == 'update_price_by_qty') { // Ajout / Mise à jour d'un prix par qu
if (empty($quantity)) {
$error ++;
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")) . '</div>';
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), 'errors');
}
if (empty($newprice)) {
$error ++;
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")) . '</div>';
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), 'errors');
}
if (! $error) {
// Calcul du prix HT et du prix unitaire
@ -547,10 +548,6 @@ print "</table>\n";
print "</div>\n";
if (! empty($mesg)) {
dol_htmloutput_mesg($mesg);
}
/* ************************************************************************** */
/* */
/* Barre d'action */

View File

@ -43,8 +43,6 @@ $id = GETPOST("id",'int');
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="DESC";
$mesg = '';
// Security check
$result=restrictedArea($user,'stock');
@ -80,10 +78,10 @@ if ($action == 'add' && $user->rights->stock->creer)
}
$action = 'create';
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
else {
$mesg='<div class="error">'.$langs->trans("ErrorWarehouseRefRequired").'</div>';
setEventMessage($langs->trans("ErrorWarehouseRefRequired"), 'errors');
$action="create"; // Force retour sur page creation
}
}
@ -101,7 +99,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
$action='';
}
}
@ -124,18 +122,17 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
if ( $object->update($id, $user) > 0)
{
$action = '';
//$mesg = '<div class="ok">Fiche mise a jour</div>';
}
else
{
$action = 'edit';
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
else
{
$action = 'edit';
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
@ -167,8 +164,6 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$type.'">'."\n";
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
// Ref
@ -219,8 +214,6 @@ else
$id=GETPOST("id",'int');
if ($id)
{
dol_htmloutput_mesg($mesg);
$object = new Entrepot($db);
$result = $object->fetch($id);
if ($result < 0)
@ -496,7 +489,7 @@ else
*/
if (($action == 'edit' || $action == 're-edit') && 1)
{
print_fiche_titre($langs->trans("WarehouseEdit"), $mesg);
$langs->trans("WarehouseEdit");
print '<form action="fiche.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -97,7 +97,7 @@ if ($action == 'addtime' && $user->rights->projet->creer)
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorTimeSpentIsEmpty").'</div>';
setEventMessage($langs->trans("ErrorTimeSpentIsEmpty"), 'errors');
}
}
@ -128,17 +128,9 @@ if ($id)
$tasksarray=$taskstatic->getTasksArray(0,0,($project->id?$project->id:$projectsListId),$socid,0); // We want to see all task of project i am allowed to see, not only mine. Later only mine will be editable later.
$projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($user,0,($project->id?$project->id:$projectsListId),0);
$tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($project->id?$project->id:$projectsListId),0);
//var_dump($tasksarray);
//var_dump($projectsrole);
//var_dump($taskrole);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
dol_htmloutput_mesg($mesg);
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$project->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addtime">';

View File

@ -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');
}
}
@ -79,11 +79,11 @@ if ($action == 'updateMaskTask')
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');
}
}
@ -121,13 +121,13 @@ else 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);
}
}
@ -166,13 +166,13 @@ else if ($action == 'specimentask')
}
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);
}
}
@ -786,8 +786,6 @@ foreach ($dirmodels as $reldir)
print '</table><br/>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();

View File

@ -79,11 +79,11 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
setEventMessage($object->error, 'errors');
}
}
}
@ -137,7 +137,6 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{

Some files were not shown because too many files have changed in this diff Show More