Fix warnings

This commit is contained in:
Laurent Destailleur 2023-01-15 20:48:29 +01:00
parent 3026842467
commit 2d2164550f
3 changed files with 15 additions and 6 deletions

View File

@ -121,6 +121,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc
if ($action == 'validatehistory') {
$error = 0;
$nbbinddone = 0;
$nbbindfailed = 0;
$notpossible = 0;
$db->begin();
@ -266,12 +267,14 @@ if ($action == 'validatehistory') {
if (!$resqlupdate) {
$error++;
setEventMessages($db->lasterror(), null, 'errors');
$nbbindfailed++;
break;
} else {
$nbbinddone++;
}
} else {
$notpossible++;
$nbbindfailed++;
}
$i++;
@ -286,8 +289,8 @@ if ($action == 'validatehistory') {
} else {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
if ($notpossible) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $notpossible), null, 'warnings');
if ($nbbindfailed) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
}
}
}

View File

@ -101,6 +101,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou
if ($action == 'validatehistory') {
$error = 0;
$nbbinddone = 0;
$nbbindfailed = 0;
$notpossible = 0;
$db->begin();
@ -143,12 +144,14 @@ if ($action == 'validatehistory') {
if (!$resqlupdate) {
$error++;
setEventMessages($db->lasterror(), null, 'errors');
$nbbindfailed++;
break;
} else {
$nbbinddone++;
}
} else {
$notpossible++;
$nbbindfailed++;
}
$i++;
@ -163,8 +166,8 @@ if ($action == 'validatehistory') {
} else {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
if ($notpossible) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $notpossible), null, 'warnings');
if ($nbbindfailed) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
}
}
}

View File

@ -119,6 +119,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou
if ($action == 'validatehistory') {
$error = 0;
$nbbinddone = 0;
$nbbindfailed = 0;
$notpossible = 0;
$db->begin();
@ -264,12 +265,14 @@ if ($action == 'validatehistory') {
if (!$resqlupdate) {
$error++;
setEventMessages($db->lasterror(), null, 'errors');
$nbbindfailed++;
break;
} else {
$nbbinddone++;
}
} else {
$notpossible++;
$nbbindfailed++;
}
$i++;
@ -284,8 +287,8 @@ if ($action == 'validatehistory') {
} else {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
if ($notpossible) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $notpossible), null, 'warnings');
if ($nbbindfailed) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
}
}
}