Merge pull request #20424 from marc-dll/13.0_FIX_propal_mass_action

FIX: propal list mass action translations and error management
This commit is contained in:
Laurent Destailleur 2022-03-23 15:53:28 +01:00 committed by GitHub
commit d92ed35447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 7 deletions

View File

@ -272,9 +272,9 @@ if ($action == 'validate') {
$db->begin();
$error = 0;
foreach ($toselect as $checked) {
if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->fetch($checked) > 0) {
if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
if ($tmpproposal->valid($user)) {
if ($tmpproposal->valid($user) > 0) {
setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
} else {
setEventMessage($langs->trans('CantBeValidated'), 'errors');
@ -285,7 +285,7 @@ if ($action == 'validate') {
$error++;
}
} else {
dol_print_error($db);
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;
}
}
@ -305,14 +305,14 @@ if ($action == "sign") {
$db->begin();
$error = 0;
foreach ($toselect as $checked) {
if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->fetch($checked) > 0) {
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
$tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
if ($tmpproposal->update($user)) {
if ($tmpproposal->update($user) > 0) {
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
} else {
dol_print_error($db);
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;
}
} else {
@ -320,7 +320,7 @@ if ($action == "sign") {
$error++;
}
} else {
dol_print_error($db);
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;
}
}

View File

@ -84,6 +84,17 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
IsNotADraft=is not a draft
PassedInOpenStatus=has been validated
CantBeSign=cannot be signed
Sign=Sign
Signed=signed
CantBeSign=cannot be signed
CantBeValidated=cannot be validated
ConfirmMassValidation=Bulk Validate confirmation
ConfirmMassSignature=Bulk Signature confirmation
ConfirmMassValidationQuestion=Are you sure you want to validate the selected records ?
ConfirmMassSignatureQuestion=Are you sure you want to sign the selected records ?
IdProposal=Proposal ID
IdProduct=Product ID
PrParentLine=Proposal Parent Line