[Qual] Uniformize code
This commit is contained in:
parent
209ec62bfe
commit
42ed3d2bb7
@ -692,7 +692,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
setEventMessage($db->error(), 'errors');
|
||||
setEventMessages($db->error(), null, 'errors');
|
||||
}
|
||||
}
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
|
||||
@ -111,7 +111,7 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin)
|
||||
if (! $resql)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
|
||||
// Add event purge
|
||||
|
||||
@ -105,7 +105,7 @@ if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allf
|
||||
|
||||
if ($count) $mesg=$langs->trans("PurgeNDirectoriesDeleted", $count);
|
||||
else $mesg=$langs->trans("PurgeNothingToDelete");
|
||||
setEventMessage($mesg);
|
||||
setEventMessages($mesg, null, 'mesgs');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($db->lasterror(),'errors');
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($db->lasterror(),'errors');
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -402,7 +402,7 @@ if (empty($reshook))
|
||||
$langs->load("errors");
|
||||
$error ++;
|
||||
|
||||
setEventMessage($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), 'errors');
|
||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ if (empty($reshook))
|
||||
{
|
||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
||||
$error ++;
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
@ -448,7 +448,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (count($object->errors)) setEventMessage($object->errors, 'errors');
|
||||
if (count($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
@ -1054,7 +1054,7 @@ if (empty($reshook))
|
||||
if ($discountid > 0) {
|
||||
$result = $object->insert_discount($discountid); // This include link_to_invoice
|
||||
} else {
|
||||
setEventMessage($discount->error, 'errors');
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$error ++;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ if (empty($reshook))
|
||||
$object->fetch($id);
|
||||
if ($object->setstatus(0)<0)
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -158,7 +158,7 @@ if (empty($reshook))
|
||||
$object->fetch($id);
|
||||
if ($object->setstatus(1)<0)
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -397,8 +397,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessage($object->errors,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'edit';
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,12 +65,12 @@ if ($action == 'dolibarr2ldap')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans("ContactSynchronized"));
|
||||
setEventMessages($langs->trans("ContactSynchronized"), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user