Merge pull request #20426 from marc-dll/14.0_FIX_propal_mass_actions

FIX: propal list mass action translations and error management (v14 edition)
This commit is contained in:
Laurent Destailleur 2022-03-23 15:52:44 +01:00 committed by GitHub
commit b104047365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -405,27 +405,28 @@ if ($action == "sign" && $permissiontoclose) {
}
}
}
if ($action == "nosign" && $permissiontoclose) {
if (GETPOST('confirm') == 'yes') {
$tmpproposal = new Propal($db);
$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_NOTSIGNED;
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED)) {
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
} else {
dol_print_error($db);
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;
}
} else {
setEventMessage($tmpproposal->ref." ".$langs->trans('CantBeClosed'), 'errors');
setEventMessage($tmpproposal->ref." ".$langs->trans('CantBeNoSign'), 'errors');
$error++;
}
} else {
dol_print_error($db);
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;
}
}

View File

@ -85,6 +85,11 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
NoSign=Set not signed
NoSigned=set not signed
CantBeNoSign=cannot be set not signed
ConfirmMassNoSignature=Bulk Not signed confirmation
ConfirmMassNoSignatureQuestion=Are you sure you want to set not signed the selected records ?
IdProposal=Proposal ID
IdProduct=Product ID
PrParentLine=Proposal Parent Line