Migrated old error notifications to the """new""" system

This commit is contained in:
Marcos García de La Fuente 2014-07-20 01:43:46 +02:00
parent ac824728bc
commit 43597c1731
22 changed files with 98 additions and 151 deletions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -90,13 +90,13 @@ if ($action == 'createtask' && $user->rights->projet->creer)
{
if (empty($label))
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
$action='create';
$error++;
}
else if (empty($_POST['task_parent']))
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("ChildOfTask"));
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ChildOfTask")), 'errors');
$action='create';
$error++;
}
@ -267,8 +267,6 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie
print_fiche_titre($langs->trans("NewTask"));
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="createtask">';

View File

@ -442,14 +442,6 @@ else {
print "</table>";
print "</form>";
/*
* Errors
*/
dol_htmloutput_errors($warning);
dol_htmloutput_errors($error,$errors);
llxFooter();
$db->close();