Fix error management
This commit is contained in:
parent
12c1531b3b
commit
f2088a084f
@ -377,21 +377,24 @@ if (empty($reshook))
|
|||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
$result = $object->update($contactid, $user);
|
if (! $error)
|
||||||
|
|
||||||
if ($result > 0) {
|
|
||||||
// Categories association
|
|
||||||
$categories = GETPOST('contcats', 'array');
|
|
||||||
$object->setCategories($categories);
|
|
||||||
|
|
||||||
$object->old_lastname='';
|
|
||||||
$object->old_firstname='';
|
|
||||||
$action = 'view';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
$result = $object->update($contactid, $user);
|
||||||
$action = 'edit';
|
|
||||||
|
if ($result > 0) {
|
||||||
|
// Categories association
|
||||||
|
$categories = GETPOST('contcats', 'array');
|
||||||
|
$object->setCategories($categories);
|
||||||
|
|
||||||
|
$object->old_lastname='';
|
||||||
|
$object->old_firstname='';
|
||||||
|
$action = 'view';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$action = 'edit';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,8 +503,8 @@ else
|
|||||||
$linkback='';
|
$linkback='';
|
||||||
print load_fiche_titre($title,$linkback,'title_companies.png');
|
print load_fiche_titre($title,$linkback,'title_companies.png');
|
||||||
|
|
||||||
// Affiche les erreurs
|
// Show errors
|
||||||
dol_htmloutput_errors(is_numeric($error)?'':$error,$errors);
|
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -775,8 +778,8 @@ else
|
|||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->fetch($object->socid);
|
$objsoc->fetch($object->socid);
|
||||||
|
|
||||||
// Affiche les erreurs
|
// Show errors
|
||||||
dol_htmloutput_errors($error,$errors);
|
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -1073,11 +1076,10 @@ else
|
|||||||
{
|
{
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
|
|
||||||
/*
|
// View mode
|
||||||
* Fiche en mode visualisation
|
|
||||||
*/
|
|
||||||
|
|
||||||
dol_htmloutput_errors($error,$errors);
|
// Show errors
|
||||||
|
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $title, -1, 'contact');
|
dol_fiche_head($head, 'card', $title, -1, 'contact');
|
||||||
|
|
||||||
|
|||||||
@ -1901,7 +1901,6 @@ class ExtraFields
|
|||||||
$error_field_required[] = $langs->transnoentitiesnoconv($value);
|
$error_field_required[] = $langs->transnoentitiesnoconv($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($key_type,array('date')))
|
if (in_array($key_type,array('date')))
|
||||||
{
|
{
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user