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:
commit
a3d2dcb97f
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user