Retours PR

This commit is contained in:
Adrien Raze 2020-09-03 14:25:17 +02:00
parent 8c514c8025
commit bcd9a0b29f
2 changed files with 22 additions and 12 deletions

View File

@ -1312,23 +1312,30 @@ if ($resql)
print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
if ($action == 'validate') {
if (GETPOST('confirm') == 'yes') {
$tmpproposal = new Propal($db);
foreach ($toselect as $checked) {
$tmpproposal->fetch($checked);
if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->statut == 0) {
$tmpproposal->valid($user);
setEventMessage($tmpproposal->ref . " " . $langs->trans('PassedInOpenStatus'), 'mesgs');
} else {
setEventMessage($tmpproposal->ref . " " . $langs->trans('IsNotADraft'), 'errors');
if (GETPOST('confirm') == 'yes') {
$tmpproposal = new Propal($db);
$db->begin();
foreach ($toselect as $checked) {
if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->statut == 0) {
if($tmpproposal->valid($user)){
setEventMessage($tmpproposal->ref . " " . $langs->trans('PassedInOpenStatus'), 'mesgs');
} else {
setEventMessage($langs->trans('CantBeValidated'), 'errors');
}
} else {
setEventMessage($tmpproposal->ref . " " . $langs->trans('IsNotADraft'), 'errors');
}
}
}
$db->commit();
}
}
if ($action == "sign") {
if (GETPOST('confirm') == 'yes') {
$tmpproposal = new Propal($db);
$db->begin();
foreach ($toselect as $checked) {
$tmpproposal->fetch($checked);
if ($tmpproposal->fetch($checked)) {
@ -1347,11 +1354,13 @@ if ($resql)
dol_print_error($db);
}
}
$db->commit();
}
}
} else {
} else {
dol_print_error($db);
}
}
// End of page
llxFooter();

View File

@ -91,6 +91,7 @@ CantBeSign = ne peut pas être signée
Sign = Signer
Signed = signé
CantBeSign = ne peut pas être signé
CantBeValidated = Ne peut pas être validé
ConfirmMassValidation = Confirmer la validation ?
ConfirmMassSignature = Confirmer la signature ?
ConfirmMassValidationQuestion = Voulez-vous confirmer la validation des devis brouillons selectionnés ?