Deprecating arbitrary use of dol_htmloutput* functions

This commit is contained in:
Marcos García de La Fuente 2014-07-20 02:32:13 +02:00
parent 43597c1731
commit 4f4ac30fc0
48 changed files with 167 additions and 273 deletions

View File

@ -60,11 +60,11 @@ if ($action == 'update')
if (! $error) if (! $error)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else 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_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
dol_htmloutput_mesg($mesg);
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';

View File

@ -60,8 +60,6 @@ if (! $result)
if ($action == 'dolibarr2ldap') if ($action == 'dolibarr2ldap')
{ {
$message="";
$db->begin(); $db->begin();
$ldap=new Ldap(); $ldap=new Ldap();
@ -157,10 +155,6 @@ print '</table>';
print '</div>'; print '</div>';
dol_htmloutput_mesg($message);
/* /*
* Barre d'actions * Barre d'actions
*/ */

View File

@ -43,7 +43,6 @@ foreach($dirmenus as $dirmenu)
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha'); $confirm=GETPOST('confirm','alpha');
$mesg=GETPOST('mesg');
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD; $menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
@ -187,7 +186,9 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
{ {
$db->commit(); $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 ; exit ;
} }
else else
@ -216,9 +217,6 @@ llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss);
print_fiche_titre($langs->trans("Menus"),'','setup'); print_fiche_titre($langs->trans("Menus"),'','setup');
dol_htmloutput_mesg($mesg);
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/menus.php"; $head[$h][0] = DOL_URL_ROOT."/admin/menus.php";

View File

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

View File

@ -42,12 +42,12 @@ if ($action == 'setvalue')
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$db->rollback(); $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 '</td></tr>';
print '</table><br /><center><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center></form>'; print '</table><br /><center><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center></form>';
dol_htmloutput_mesg($mesg);
$db->close(); $db->close();
llxFooter(); llxFooter();

View File

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

View File

@ -67,12 +67,12 @@ if (GETPOST('action','alpha') == 'set')
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$db->rollback(); $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"; print "</form>\n";
dol_htmloutput_mesg($mesg);
$db->close(); $db->close();
llxFooter(); llxFooter();

View File

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

View File

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

View File

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

View File

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

View File

@ -445,6 +445,8 @@ if ($action == 'send' && empty($_POST["cancel"]))
// Action add emailing // Action add emailing
if ($action == 'add') if ($action == 'add')
{ {
$mesgs = array();
$object->email_from = trim($_POST["from"]); $object->email_from = trim($_POST["from"]);
$object->email_replyto = trim($_POST["replyto"]); $object->email_replyto = trim($_POST["replyto"]);
$object->email_errorsto = trim($_POST["errorsto"]); $object->email_errorsto = trim($_POST["errorsto"]);
@ -454,21 +456,27 @@ if ($action == 'add')
$object->bgcolor = trim($_POST["bgcolor"]); $object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]); $object->bgimage = trim($_POST["bgimage"]);
if (! $object->titre) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle")); if (! $object->titre) {
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic")); $mesgs[] = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
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->create($user) >= 0) if ($object->create($user) >= 0)
{ {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
$mesg=$object->error; $mesgs[] = $object->error;
} }
setEventMessage($mesg, 'errors'); setEventMessage($mesgs, 'errors');
$action="create"; $action="create";
} }
@ -481,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_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_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 == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
else if ($action == 'settitre' && empty($object->titre)) {
else if ($action == 'settitre' && empty($object->titre)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle")); $mesg = $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 == 'setfrom' && empty($object->email_from)) {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
}
if (! $mesg) if (! $mesg)
{ {
@ -492,7 +503,7 @@ if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyt
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
$mesg=$object->error; $mesg = $object->error;
} }
setEventMessage($mesg, 'errors'); setEventMessage($mesg, 'errors');
@ -535,25 +546,31 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
if (! $isupload) if (! $isupload)
{ {
$mesgs = array();
$object->sujet = trim($_POST["sujet"]); $object->sujet = trim($_POST["sujet"]);
$object->body = trim($_POST["body"]); $object->body = trim($_POST["body"]);
$object->bgcolor = trim($_POST["bgcolor"]); $object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]); $object->bgimage = trim($_POST["bgimage"]);
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic")); if (! $object->sujet) {
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage")); $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) if ($object->update($user) >= 0)
{ {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
$mesg=$object->error; $mesgs[] =$object->error;
} }
setEventMessage($mesg, 'errors'); setEventMessage($mesgs, 'errors');
$action="edit"; $action="edit";
} }
else else
@ -730,9 +747,9 @@ else
{ {
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM, // Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message // on affiche donc juste un message
$mesgembedded.='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>'; setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
$mesgembedded.='<br><textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>'; setEventMessage('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
$mesgembedded.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>'; setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
$_GET["action"]=''; $_GET["action"]='';
} }
else else
@ -912,12 +929,6 @@ else
print '<br><br></div>'; print '<br><br></div>';
} }
if (! empty($mesgembedded))
{
dol_htmloutput_mesg($mesgembedded,'','warning',1);
print '<br>';
}
// Affichage formulaire de TEST // Affichage formulaire de TEST
if ($action == 'test') if ($action == 'test')
{ {

View File

@ -45,7 +45,6 @@ if ($action == 'add')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg='';
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int')); $dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$amount= GETPOST('amount','int'); $amount= GETPOST('amount','int');
@ -53,22 +52,22 @@ if ($action == 'add')
if (! $label) if (! $label)
{ {
$error=1; $error=1;
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("Description"))."</div>"; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors');
} }
if (! $amount) if (! $amount)
{ {
$error=1; $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')) if (! GETPOST('account_from','int'))
{ {
$error=1; $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')) if (! GETPOST('account_to','int'))
{ {
$error=1; $error=1;
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo"))."</div>"; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo")), 'errors');
} }
if (! $error) if (! $error)
{ {
@ -111,20 +110,19 @@ if ($action == 'add')
if (! $error) if (! $error)
{ {
$mesg.="<div class=\"ok\">"; $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));
$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)); setEventMessage($mesgs);
$mesg.="</div>";
$db->commit(); $db->commit();
} }
else else
{ {
$mesg.="<div class=\"error\">".$accountfrom->error.' '.$accountto->error."</div>"; setEventMessage($accountfrom->error.' '.$accountto->error, 'errors');
$db->rollback(); $db->rollback();
} }
} }
else 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")); print_fiche_titre($langs->trans("BankTransfer"));
dol_htmloutput_mesg($mesg);
print $langs->trans("TransferDesc"); print $langs->trans("TransferDesc");
print "<br><br>"; print "<br><br>";

View File

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

View File

@ -453,8 +453,6 @@ if ($resql)
print_fiche_titre($titre,$link); 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 //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 .'">'; print '<form id="form_unpaid" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
if (! empty($mode) && $action == 'presend') if (! empty($mode) && $action == 'presend')

View File

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

View File

@ -69,7 +69,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
} }
else 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"]); $dateperiod=@dol_mktime($_POST["periodhour"],$_POST["periodmin"],$_POST["periodsec"],$_POST["periodmonth"],$_POST["periodday"],$_POST["periodyear"]);
if (! $dateech) if (! $dateech)
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
$action = 'create'; $action = 'create';
} }
elseif (! $dateperiod) elseif (! $dateperiod)
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors');
$action = 'create'; $action = 'create';
} }
elseif (! $_POST["actioncode"] > 0) 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'; $action = 'create';
} }
elseif (! $_POST["amount"]) elseif (! $_POST["amount"])
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
$action = 'create'; $action = 'create';
} }
else else
@ -124,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"]); $dateperiod=dol_mktime($_POST["periodhour"],$_POST["periodmin"],$_POST["periodsec"],$_POST["periodmonth"],$_POST["periodday"],$_POST["periodyear"]);
if (! $dateech) if (! $dateech)
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
$action = 'edit'; $action = 'edit';
} }
elseif (! $dateperiod) elseif (! $dateperiod)
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors');
$action = 'edit'; $action = 'edit';
} }
else else
@ -168,8 +168,6 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewSocialContribution")); print_fiche_titre($langs->trans("NewSocialContribution"));
print "<br>\n"; print "<br>\n";
dol_htmloutput_mesg($mesg);
$var=false; $var=false;
print '<form name="charge" method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="charge" method="post" action="'.$_SERVER["PHP_SELF"].'">';
@ -238,8 +236,6 @@ if ($id > 0)
if ($result > 0) if ($result > 0)
{ {
dol_htmloutput_mesg($mesg);
$head=tax_prepare_head($object); $head=tax_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); 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); 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)) if (empty($mysoc->country_id) && empty($mysoc->country_code))
{ {
print '<div class="error">'; 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); 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 '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -60,8 +60,6 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
dol_htmloutput_mesg($mesg);
$societe = new Societe($db); $societe = new Societe($db);
if ($societe->fetch($object->socid)) 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') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>'; setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
} }
else else
{ {
$mesg = '<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
} }
} }
} }
@ -126,7 +126,6 @@ $userstatic=new User($db);
/* Mode vue et edition */ /* Mode vue et edition */
/* */ /* */
/* *************************************************************************** */ /* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {

View File

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

View File

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

View File

@ -58,18 +58,17 @@ if ($action == 'add' || GETPOST('modify','alpha'))
$ftp_server = "FTP_SERVER_" . $entry; //$_POST["numero_entry"]; $ftp_server = "FTP_SERVER_" . $entry; //$_POST["numero_entry"];
$error=0; $error=0;
$mesg='';
if (! GETPOST("$ftp_name",'alpha')) if (! GETPOST("$ftp_name",'alpha'))
{ {
$error=1; $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')) if (! GETPOST("$ftp_server",'alpha'))
{ {
$error=1; $error=1;
$mesg.='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")), 'errors');
} }
if (! $error) if (! $error)
@ -299,9 +298,6 @@ else
} }
dol_htmloutput_mesg($mesg);
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -102,7 +102,7 @@ elseif($action == 'add_event')
if ($error) if ($error)
{ {
$message = '<div class="error">'.$langs->trans('ErrorAddEventToUserCP').'</div>'; setEventMessage($langs->trans('ErrorAddEventToUserCP'), 'errors');
} }
else else
{ {
@ -115,10 +115,8 @@ elseif($action == 'add_event')
$holiday->updateSoldeCP($userCP,$new_holiday); $holiday->updateSoldeCP($userCP,$new_holiday);
$message = $langs->trans('AddEventToUserOkCP'); setEventMessage($langs->trans('AddEventToUserOkCP'));
} }
dol_htmloutput_mesg($message);
} }
$langs->load('users'); $langs->load('users');

View File

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

View File

@ -91,12 +91,12 @@ if ($action == 'setModuleOptions')
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$db->rollback(); $db->rollback();
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
@ -178,11 +178,11 @@ if($action)
if (! $error) if (! $error)
{ {
$mesg = '<font class="ok">'.$langs->trans("SetupSaved").'</font>'; setEventMessage($langs->trans("SetupSaved"));
} }
else 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 else
{ {
//TODO: Translate
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n"; print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
} }
print '</table>'; print '</table>';
} }
dol_htmloutput_mesg($mesg);
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -230,7 +230,9 @@ else
llxHeader('',$title,$helpurl,''); llxHeader('',$title,$helpurl,'');
// Displays product removal confirmation // 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="&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:""); $param.=($fourn_id?"&amp;fourn_id=".$fourn_id:"");

View File

@ -97,7 +97,7 @@ if ($action == 'addtime' && $user->rights->projet->creer)
} }
else 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. $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); $projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($user,0,($project->id?$project->id:$projectsListId),0);
$tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($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); 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 '<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="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addtime">'; print '<input type="hidden" name="action" value="addtime">';

View File

@ -60,11 +60,11 @@ if ($action == 'updateMask')
if (! $error) if (! $error)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
@ -79,11 +79,11 @@ if ($action == 'updateMaskTask')
if (! $error) if (! $error)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
@ -121,13 +121,13 @@ else if ($action == 'specimen')
} }
else else
{ {
$mesg='<div class="error">'.$obj->error.'</div>'; setEventMessage($obj->error, 'errors');
dol_syslog($obj->error, LOG_ERR); dol_syslog($obj->error, LOG_ERR);
} }
} }
else else
{ {
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>'; setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
} }
@ -166,13 +166,13 @@ else if ($action == 'specimentask')
} }
else else
{ {
$mesg='<div class="error">'.$obj->error.'</div>'; setEventMessage($obj->error, 'errors');
dol_syslog($obj->error, LOG_ERR); dol_syslog($obj->error, LOG_ERR);
} }
} }
else else
{ {
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>'; setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
} }
@ -786,8 +786,6 @@ foreach ($dirmodels as $reldir)
print '</table><br/>'; print '</table><br/>';
dol_htmloutput_mesg($mesg);
$db->close(); $db->close();
llxFooter(); llxFooter();

View File

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

View File

@ -92,7 +92,7 @@ if (empty($reshook))
else else
{ {
dol_syslog($object->error,LOG_DEBUG); dol_syslog($object->error,LOG_DEBUG);
$mesg='<div class="error">'.$langs->trans("CantRemoveProject").'</div>'; setEventMessage($langs->trans("CantRemoveProject"), 'errors');
} }
} }
header("Location: ".$backtopage); header("Location: ".$backtopage);
@ -111,7 +111,7 @@ if (empty($reshook))
else else
{ {
dol_syslog($object->error,LOG_DEBUG); dol_syslog($object->error,LOG_DEBUG);
$mesg='<div class="error">'.$langs->trans("CantRemoveProject").'</div>'; setEventMessage($langs->trans("CantRemoveProject"), 'errors');
} }
} }
@ -120,12 +120,12 @@ if (empty($reshook))
$error=0; $error=0;
if (empty($_POST["ref"])) if (empty($_POST["ref"]))
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors');
$error++; $error++;
} }
if (empty($_POST["title"])) if (empty($_POST["title"]))
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
$error++; $error++;
} }
@ -155,14 +155,14 @@ if (empty($reshook))
if ($result < 0) if ($result < 0)
{ {
$langs->load("errors"); $langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>'; setEventMessage($langs->trans($object->error), 'errors');
$error++; $error++;
} }
} }
else else
{ {
$langs->load("errors"); $langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>'; setEventMessage($langs->trans($object->error), 'errors');
$error++; $error++;
} }
@ -194,13 +194,13 @@ if (empty($reshook))
{ {
$error++; $error++;
//$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors');
} }
if (empty($_POST["title"])) if (empty($_POST["title"]))
{ {
$error++; $error++;
//$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
} }
$db->begin(); $db->begin();
@ -245,7 +245,7 @@ if (empty($reshook))
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
$mesg='<div class="error">'.$langs->trans("ErrorShiftTaskDate").':'.$object->error.'</div>'; setEventMessage($langs->trans("ErrorShiftTaskDate").':'.$object->error, 'errors');
} }
} }
} }
@ -306,7 +306,7 @@ if (empty($reshook))
$result = $object->setValid($user); $result = $object->setValid($user);
if ($result <= 0) if ($result <= 0)
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
} }
} }
@ -315,7 +315,7 @@ if (empty($reshook))
$result = $object->setClose($user); $result = $object->setClose($user);
if ($result <= 0) if ($result <= 0)
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
} }
} }
@ -324,7 +324,7 @@ if (empty($reshook))
$result = $object->setValid($user); $result = $object->setValid($user);
if ($result <= 0) if ($result <= 0)
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
} }
} }
@ -355,7 +355,7 @@ if (empty($reshook))
$result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes); $result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes);
if ($result <= 0) if ($result <= 0)
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
} }
else else
{ {
@ -391,8 +391,6 @@ if ($action == 'create' && $user->rights->projet->creer)
print_fiche_titre($langs->trans("NewProject")); print_fiche_titre($langs->trans("NewProject"));
dol_htmloutput_mesg($mesg);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
@ -490,8 +488,6 @@ else
* Show or edit * Show or edit
*/ */
dol_htmloutput_mesg($mesg);
if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id); if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
$res=$object->fetch_optionals($object->id,$extralabels); $res=$object->fetch_optionals($object->id,$extralabels);

View File

@ -199,8 +199,6 @@ if ($id > 0 || ! empty($ref))
$head=project_prepare_head($object); $head=project_prepare_head($object);
dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project')); dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project'));
dol_htmloutput_mesg();
$param=($mode=='mine'?'&mode=mine':''); $param=($mode=='mine'?'&mode=mine':'');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -75,11 +75,11 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>'; setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
} }
else else
{ {
$mesg = '<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
} }
} }
} }
@ -223,8 +223,6 @@ if ($id > 0 || ! empty($ref))
//$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
//$arrayofuseridoftask=$object->getListContactId('internal'); //$arrayofuseridoftask=$object->getListContactId('internal');
dol_htmloutput_mesg($mesg);
$head = task_prepare_head($object); $head = task_prepare_head($object);
dol_fiche_head($head, 'task_contact', $langs->trans("Task"), 0, 'projecttask'); dol_fiche_head($head, 'task_contact', $langs->trans("Task"), 0, 'projecttask');

View File

@ -69,7 +69,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
if (empty($_POST["label"])) if (empty($_POST["label"]))
{ {
$error++; $error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
} }
if (! $error) if (! $error)
{ {
@ -122,7 +122,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->s
else else
{ {
$langs->load("errors"); $langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>'; setEventMessage($langs->trans($object->error), 'errors');
$action=''; $action='';
} }
} }
@ -294,8 +294,6 @@ if ($id > 0 || ! empty($ref))
//$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
//$arrayofuseridoftask=$object->getListContactId('internal'); //$arrayofuseridoftask=$object->getListContactId('internal');
dol_htmloutput_mesg($mesg);
$head=task_prepare_head($object); $head=task_prepare_head($object);
dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask'); dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');

View File

@ -263,8 +263,6 @@ if ($id > 0 || ! empty($ref))
$head=task_prepare_head($object); $head=task_prepare_head($object);
dol_fiche_head($head, 'task_time', $langs->trans("Task"),0,'projecttask'); dol_fiche_head($head, 'task_time', $langs->trans("Task"),0,'projecttask');
dol_htmloutput_mesg($mesg);
if ($action == 'deleteline') if ($action == 'deleteline')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1);

View File

@ -77,11 +77,11 @@ if ($action == 'updateoptions')
if (! $res > 0) $error++; if (! $res > 0) $error++;
if (! $error) if (! $error)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
@ -92,11 +92,11 @@ if ($action == 'updateoptions')
if (! $res > 0) $error++; if (! $res > 0) $error++;
if (! $error) if (! $error)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
} }
@ -121,12 +121,12 @@ if ($action == 'setModuleOptions')
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$db->rollback(); $db->rollback();
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
@ -220,11 +220,11 @@ if ($action=="setaddrefinlist") {
if (! $res > 0) $error++; if (! $res > 0) $error++;
if (! $error) if (! $error)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>"; setEventMessage($langs->trans("Error"), 'errors');
} }
} }
@ -298,9 +298,6 @@ $head = societe_admin_prepare_head(null);
dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), 0, 'company'); dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), 0, 'company');
dol_htmloutput_mesg($mesg);
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
// Module to manage customer/supplier code // Module to manage customer/supplier code

View File

@ -66,12 +66,12 @@ if ($action == 'add')
if (empty($contactid)) if (empty($contactid))
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")), 'errors');
$error++; $error++;
} }
if ($actionid <= 0) if ($actionid <= 0)
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors');
$error++; $error++;
} }
@ -258,8 +258,6 @@ if ($result > 0)
print '</form>'; print '</form>';
print '<br>'; print '<br>';
dol_htmloutput_mesg($mesg);
// List of active notifications // List of active notifications
print_fiche_titre($langs->trans("ListOfActiveNotifications"),'',''); print_fiche_titre($langs->trans("ListOfActiveNotifications"),'','');
$var=true; $var=true;

View File

@ -79,7 +79,7 @@ if ($action == 'update' && ! $_POST["cancel"])
$result = $account->update($user); $result = $account->update($user);
if (! $result) if (! $result)
{ {
$message=$account->error; setEventMessage($account->error, 'errors');
$_GET["action"]='edit'; // Force chargement page edition $_GET["action"]='edit'; // Force chargement page edition
} }
else else
@ -137,7 +137,7 @@ if ($action == 'add' && ! $_POST["cancel"])
$result = $account->update($user); // TODO Use create and include update into create method $result = $account->update($user); // TODO Use create and include update into create method
if (! $result) if (! $result)
{ {
$message=$account->error; setEventMessage($account->error, 'errors');
$_GET["action"]='create'; // Force chargement page création $_GET["action"]='create'; // Force chargement page création
} }
else else
@ -158,7 +158,7 @@ if ($action == 'setasdefault')
header('Location: '.$url); header('Location: '.$url);
exit; exit;
} else { } else {
$message=$db->lasterror; setEventMessage($db->lasterror, 'errors');
} }
} }
@ -176,12 +176,12 @@ if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes')
} }
else else
{ {
$message = $account->error; setEventMessage($account->error, 'errors');
} }
} }
else else
{ {
$message = $account->error; setEventMessage($account->error, 'errors');
} }
} }
@ -399,8 +399,6 @@ if ($socid && $action != 'edit' && $action != "create")
if ($socid && $action == 'edit' && $user->rights->societe->creer) if ($socid && $action == 'edit' && $user->rights->societe->creer)
{ {
dol_htmloutput_mesg($message);
print '<form action="rib.php?socid='.$soc->id.'" method="post">'; print '<form action="rib.php?socid='.$soc->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
@ -515,8 +513,6 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
if ($socid && $action == 'create' && $user->rights->societe->creer) if ($socid && $action == 'create' && $user->rights->societe->creer)
{ {
dol_htmloutput_mesg($message);
print '<form action="rib.php?socid='.$soc->id.'" method="post">'; print '<form action="rib.php?socid='.$soc->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';

View File

@ -284,7 +284,7 @@ if ($resql)
// Show delete result message // Show delete result message
if (GETPOST('delsoc')) if (GETPOST('delsoc'))
{ {
dol_htmloutput_mesg($langs->trans("CompanyDeleted",GETPOST('delsoc')),'','ok'); setEventMessage($langs->trans("CompanyDeleted",GETPOST('delsoc')));
} }
$langs->load("other"); $langs->load("other");