Fix better error message

This commit is contained in:
Laurent Destailleur 2015-11-06 19:07:05 +01:00
parent b2d9f21253
commit e7554d377f

View File

@ -510,7 +510,7 @@ if ($id == 10)
}
// Actions ajout ou modification d'une entree dans un dictionnaire de donnee
// Actions add or modify an entry into a dictionary
if (GETPOST('actionadd') || GETPOST('actionmodify'))
{
$listfield=explode(',',$tabfield[$id]);
@ -581,7 +581,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors');
}
}
if ($id == 3 && ! is_numeric($_POST["code"]))
{
$ok=0;
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors');
}
// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0