NEW Can add event to log into blockedlog module with a constant.

This commit is contained in:
Laurent Destailleur 2020-09-29 21:51:39 +02:00
parent 1e176fad8f
commit f063a144c1
2 changed files with 8 additions and 0 deletions

View File

@ -185,6 +185,13 @@ class BlockedLog
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all POS modules
$moduleposenabled = ($conf->cashdesk->enabled || $conf->takepos->enabled || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE';
if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) {
$tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED);
foreach ($tmparrayofmoresupportedevents as $val) {
$this->trackedevents[$val] = 'log'.$val;
}
}
}
/**

View File

@ -83,6 +83,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|| $action === 'CASHCONTROL_VALIDATE'
|| (in_array($object->element, array('facture', 'supplier_invoice')) && $action === 'DOC_DOWNLOAD' && $object->statut != 0)
|| (in_array($object->element, array('facture', 'supplier_invoice')) && $action === 'DOC_PREVIEW' && $object->statut != 0)
|| (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED) && in_array($action, explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)))
)
{
$qualified++;