Merge pull request #3778 from grandoc/develop

[Qual] Uniformize code
This commit is contained in:
Laurent Destailleur 2015-10-22 10:39:55 +02:00
commit a5912d1909
8 changed files with 20 additions and 20 deletions

View File

@ -76,7 +76,7 @@ if ($action == 'disable') {
$action = 'update'; $action = 'update';
if ($result < 0) { if ($result < 0) {
setEventMessage($accounting->error, 'errors'); setEventMessages($accounting->error, $accounting->errors, 'errors');
} }
} else if ($action == 'enable') { } else if ($action == 'enable') {
if ($accounting->fetch($id)) { if ($accounting->fetch($id)) {
@ -84,7 +84,7 @@ if ($action == 'disable') {
} }
$action = 'update'; $action = 'update';
if ($result < 0) { if ($result < 0) {
setEventMessage($accounting->error, 'errors'); setEventMessages($accounting->error, $accounting->errors, 'errors');
} }
} }

View File

@ -125,7 +125,7 @@ else if ($action == 'delete')
} }
if ($result < 0) { if ($result < 0) {
setEventMessage($accounting->error, 'errors'); setEventMessages($accounting->error, $accounting->errors, 'errors');
} }
} }

View File

@ -100,9 +100,9 @@ if ($action == 'update') {
} }
if (! $error) { if (! $error) {
setEventMessage($langs->trans("SetupSaved")); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else { } else {
setEventMessage($langs->trans("Error"), 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }

View File

@ -66,7 +66,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -110,7 +110,7 @@ else if ($action == 'add')
{ {
$db->rollback(); $db->rollback();
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action='create'; $action='create';
} }
} }
@ -147,7 +147,7 @@ else if ($action == 'update')
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else

View File

@ -76,14 +76,14 @@ if ($_POST["action"] == 'import') {
$result = $accounting->create($user); $result = $accounting->create($user);
if ($result > 0) { if ($result > 0) {
setEventMessage($langs->trans("AccountingAccountAdd"), 'mesgs'); setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs');
} else { } else {
setEventMessage($accounting->error, 'errors'); setEventMessages($accounting->error, $accounting->errors, 'errors');
} }
$cpt ++; $cpt ++;
} }
} else { } else {
setEventMessage($langs->trans('AccountPlanNotFoundCheckSetting'), 'errors'); setEventMessages($langs->trans('AccountPlanNotFoundCheckSetting'), null, 'errors');
} }
} else { } else {
print '<div><font color="red">' . $langs->trans("AnyLineImport") . '</font></div>'; print '<div><font color="red">' . $langs->trans("AnyLineImport") . '</font></div>';

View File

@ -111,11 +111,11 @@ if ($action == 'update')
if (! $error) if (! $error)
{ {
setEventMessage($langs->trans("SetupSaved")); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else
{ {
setEventMessage($langs->trans("Error"),'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -126,9 +126,9 @@ if ($action == 'setlistsorttodo') {
$error ++; $error ++;
if (! $error) { if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else { } else {
setEventMessage($langs->trans("Error"), 'mesgs'); setEventMessages($langs->trans("Error"), null, 'mesgs');
} }
} }
@ -138,9 +138,9 @@ if ($action == 'setlistsortdone') {
if (! $res > 0) if (! $res > 0)
$error ++; $error ++;
if (! $error) { if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else { } else {
setEventMessage($langs->trans("Error"), 'mesgs'); setEventMessages($langs->trans("Error"), null, 'mesgs');
} }
} }

View File

@ -68,9 +68,9 @@ if ($action == 'update') {
} }
if (! $error) { if (! $error) {
setEventMessage($langs->trans("SetupSaved")); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else { } else {
setEventMessage($langs->trans("Error"), 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }

View File

@ -116,7 +116,7 @@ if ($action == 'update') {
$result=$accounting->fetch($accounting_account_id,null,1); $result=$accounting->fetch($accounting_account_id,null,1);
if ($result<0) { if ($result<0) {
//setEventMessage(null, $accounting->errors,'errors'); //setEventMessages(null, $accounting->errors, 'errors');
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '<br/> <pre>' . $sql . '</pre></font></div>'; $msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '<br/> <pre>' . $sql . '</pre></font></div>';
} else { } else {