Fix error management

This commit is contained in:
Laurent Destailleur 2020-02-22 12:19:46 +01:00
parent 18533b635a
commit 1d34ef213c
2 changed files with 136 additions and 135 deletions

View File

@ -118,10 +118,10 @@ if (($action == "searchfiles" || $action == "dl")) {
$error++; $error++;
} }
$sql = '';
if (!$error) if (!$error)
{ {
$sql = '';
$wheretail = " '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'"; $wheretail = " '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
// Customer invoices // Customer invoices
@ -178,7 +178,6 @@ if (($action == "searchfiles" || $action == "dl")) {
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
//$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT;
} }
}
if ($sql) { if ($sql) {
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
@ -323,7 +322,9 @@ if (($action == "searchfiles" || $action == "dl")) {
$db->free($resd); $db->free($resd);
} }
else { else {
setEventMessages($langs->trans("ErrorAtLeastOneObjectMustBeSelected"), null, 'errors'); setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'errors');
$error++;
}
} }
} }

View File

@ -96,7 +96,7 @@ ErrorBadMaskFailedToLocatePosOfSequence=Error, mask without sequence number
ErrorBadMaskBadRazMonth=Error, bad reset value ErrorBadMaskBadRazMonth=Error, bad reset value
ErrorMaxNumberReachForThisMask=Maximum number reached for this mask ErrorMaxNumberReachForThisMask=Maximum number reached for this mask
ErrorCounterMustHaveMoreThan3Digits=Counter must have more than 3 digits ErrorCounterMustHaveMoreThan3Digits=Counter must have more than 3 digits
ErrorSelectAtLeastOne=Error. Select at least one entry. ErrorSelectAtLeastOne=Error, select at least one entry.
ErrorDeleteNotPossibleLineIsConsolidated=Delete not possible because record is linked to a bank transaction that is conciliated ErrorDeleteNotPossibleLineIsConsolidated=Delete not possible because record is linked to a bank transaction that is conciliated
ErrorProdIdAlreadyExist=%s is assigned to another third ErrorProdIdAlreadyExist=%s is assigned to another third
ErrorFailedToSendPassword=Failed to send password ErrorFailedToSendPassword=Failed to send password