Merge pull request #19351 from cfoellmann/PR/block-massaction-delete

block deletion of items not free to delete (is_deletable)
This commit is contained in:
Laurent Destailleur 2021-11-11 14:33:23 +01:00 committed by GitHub
commit a3d2dcb97f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1295,7 +1295,14 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT) {
$langs->load("errors");
$nbignored++;
$resaction .= '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
$TMsg[] = '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
continue;
}
if ($objecttmp->is_erasable() <= 0) {
$langs->load("errors");
$nbignored++;
$TMsg[] = '<div class="error">'.$langs->trans('ErrorRecordHasChildren').' '.$objecttmp->ref.'</div><br>';
continue;
}