Update actions_massactions.inc.php
This commit is contained in:
parent
17b8de2cdd
commit
aba2ef7ad2
@ -1079,7 +1079,15 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
|
|||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if ($objectclass != 'Facture' || empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY) || (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY) && $objecttmp->statut == Facture::STATUS_DRAFT) ) {
|
// Refuse deletion for some objects/status
|
||||||
|
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>';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);
|
if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||||
else $result = $objecttmp->delete($user);
|
else $result = $objecttmp->delete($user);
|
||||||
|
|
||||||
@ -1088,7 +1096,7 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
|
|||||||
$error++;
|
$error++;
|
||||||
break;
|
break;
|
||||||
} else $nbok++;
|
} else $nbok++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user