N°9617 - Send events on data export for traceability

This commit is contained in:
Eric Espie
2026-05-18 10:08:20 +02:00
parent 48e6203869
commit 4aa1f8ae18
9 changed files with 54 additions and 1 deletions

View File

@@ -340,6 +340,7 @@ EOF
$sField = '';
$oObj = $aRow[$sAlias];
$oObj->FireEventReadDetails();
if ($oObj != null) {
switch ($sAttCode) {
case 'id':

View File

@@ -6247,7 +6247,9 @@ abstract class DBObject implements iDisplay
}
/**
* @param array $aChanges
* @param bool $bIsNew
* @param string|null $sStimulusBeingApplied
*
* @return void
* @since 3.1.0
@@ -6256,6 +6258,18 @@ abstract class DBObject implements iDisplay
{
}
//////////////
/// READ
///
/**
* @return void
* @since 3.3.0
*/
public function FireEventReadDetails(): void
{
}
//////////////
/// DELETE
///

View File

@@ -293,6 +293,7 @@ EOF
$sAttCode = $aFieldSpec['sAttCode'];
$oObj = $aRow[$sAlias];
$oObj->FireEventReadDetails();
$sField = '';
if ($oObj) {
$sField = $this->GetValue($oObj, $sAttCode);

View File

@@ -144,6 +144,7 @@ class HTMLBulkExport extends TabularBulkExport
$sAttCode = $aFieldSpec['sAttCode'];
$oObj = $aRow[$sAlias];
$oObj->FireEventReadDetails();
$sField = '';
if ($oObj) {
$sField = $this->GetValue($oObj, $sAttCode);

View File

@@ -531,6 +531,7 @@ class CoreServices implements iRestServiceProvider, iRestInputSanitizer
}
while ($oObject = $oObjectSet->Fetch()) {
$oObject->FireEventReadDetails();
$oResult->AddObject(0, '', $oObject, $aShowFields, $bExtendedOutput);
}
$oResult->message = "Found: ".$oObjectSet->Count();
@@ -605,6 +606,7 @@ class CoreServices implements iRestServiceProvider, iRestInputSanitizer
if ($oElement instanceof RelationObjectNode) {
$oObject = $oElement->GetProperty('object');
if ($oObject) {
$oObject->FireEventReadDetails();
if ($bEnableRedundancy && $sDirection == 'down') {
// Add only the "reached" objects
if ($oElement->GetProperty('is_reached')) {

View File

@@ -233,7 +233,6 @@ EOF
public function GetNextChunk(&$aStatus)
{
$sRetCode = 'run';
$iPercentage = 0;
$oSet = new DBObjectSet($this->oSearch);
$oSet->SetLimit($this->iChunkSize, $this->aStatusInfo['position']);
@@ -261,6 +260,7 @@ EOF
$sField = '';
/** @var \DBObject $oObj */
$oObj = $aRow[$sAlias];
$oObj->FireEventReadDetails();
if ($oObj == null) {
$sData .= "<td x:str></td>";
continue;

View File

@@ -146,6 +146,7 @@ class XMLBulkExport extends BulkExport
}
foreach ($aAuthorizedClasses as $sAlias => $sClassName) {
$oObj = $aObjects[$sAlias];
$oObj->FireEventReadDetails();
if (is_null($oObj)) {
$sData .= "<$sClassName alias=\"$sAlias\" id=\"null\">\n";
} else {