mirror of
https://github.com/Combodo/iTop.git
synced 2026-09-29 21:09:10 +02:00
N°9617 - Send EVENT on data export for traceability
This commit is contained in:
@@ -5391,10 +5391,9 @@ JS
|
||||
* @throws \CoreException
|
||||
* @since 3.3.0
|
||||
*/
|
||||
final public function FireEventReadDetails(): void
|
||||
final public function FireEventReadDetails(string $sExportType): void
|
||||
{
|
||||
|
||||
$this->FireEvent(EVENT_DB_TRACEABILITY);
|
||||
$this->FireEvent(EVENT_DATA_EXPORT, ['export_type' => $sExportType]);
|
||||
}
|
||||
|
||||
//////////////
|
||||
|
||||
@@ -531,9 +531,13 @@ Call $this->AddInitialAttributeFlags($sAttCode, $iFlags) for all the initial att
|
||||
<type>DBObject</type>
|
||||
</event_datum>
|
||||
<event_datum id="attributes">
|
||||
<description>Attribute codes exposed (empty means all attributes)</description>
|
||||
<description>Attribute codes exposed (empty means potentially all attributes)</description>
|
||||
<type>array</type>
|
||||
</event_datum>
|
||||
<event_datum id="export_type">
|
||||
<description>Type of export</description>
|
||||
<type>string</type>
|
||||
</event_datum>
|
||||
<event_datum id="debug_info">
|
||||
<description>Debug string</description>
|
||||
<type>string</type>
|
||||
|
||||
@@ -340,7 +340,7 @@ EOF
|
||||
|
||||
$sField = '';
|
||||
$oObj = $aRow[$sAlias];
|
||||
$oObj->FireEventReadDetails();
|
||||
$oObj->FireEventReadDetails(get_class($this));
|
||||
if ($oObj != null) {
|
||||
switch ($sAttCode) {
|
||||
case 'id':
|
||||
|
||||
@@ -6266,7 +6266,7 @@ abstract class DBObject implements iDisplay
|
||||
* @return void
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function FireEventReadDetails(): void
|
||||
public function FireEventReadDetails(string $sExportType): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ EOF
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
|
||||
$oObj = $aRow[$sAlias];
|
||||
$oObj->FireEventReadDetails();
|
||||
$oObj->FireEventReadDetails(get_class($this));
|
||||
$sField = '';
|
||||
if ($oObj) {
|
||||
$sField = $this->GetValue($oObj, $sAttCode);
|
||||
|
||||
@@ -144,7 +144,7 @@ class HTMLBulkExport extends TabularBulkExport
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
|
||||
$oObj = $aRow[$sAlias];
|
||||
$oObj->FireEventReadDetails();
|
||||
$oObj->FireEventReadDetails(get_class($this));
|
||||
$sField = '';
|
||||
if ($oObj) {
|
||||
$sField = $this->GetValue($oObj, $sAttCode);
|
||||
|
||||
@@ -625,7 +625,7 @@ class CoreServices implements iRestServiceProvider, iRestInputSanitizer
|
||||
}
|
||||
|
||||
while ($oObject = $oObjectSet->Fetch()) {
|
||||
$oObject->FireEventReadDetails();
|
||||
$oObject->FireEventReadDetails(ContextTag::TAG_REST);
|
||||
$oResult->AddObject(0, '', $oObject, $aShowFields, RestUtils::HasRequestedExtendedOutput($sShowFields));
|
||||
}
|
||||
$oResult->message = "Found: ".$oObjectSet->Count();
|
||||
@@ -700,7 +700,7 @@ class CoreServices implements iRestServiceProvider, iRestInputSanitizer
|
||||
if ($oElement instanceof RelationObjectNode) {
|
||||
$oObject = $oElement->GetProperty('object');
|
||||
if ($oObject) {
|
||||
$oObject->FireEventReadDetails();
|
||||
$oObject->FireEventReadDetails(get_class($this));
|
||||
if ($bEnableRedundancy && $sDirection == 'down') {
|
||||
// Add only the "reached" objects
|
||||
if ($oElement->GetProperty('is_reached')) {
|
||||
|
||||
@@ -253,18 +253,18 @@ EOF
|
||||
set_time_limit(intval($iLoopTimeLimit));
|
||||
|
||||
$sData .= "<tr>";
|
||||
foreach ($this->aStatusInfo['fields'] as $iCol => $aFieldSpec) {
|
||||
foreach ($this->aStatusInfo['fields'] as $aFieldSpec) {
|
||||
$sAlias = $aFieldSpec['sAlias'];
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
|
||||
$sField = '';
|
||||
/** @var \DBObject $oObj */
|
||||
$oObj = $aRow[$sAlias];
|
||||
$oObj->FireEventReadDetails();
|
||||
if ($oObj == null) {
|
||||
$sData .= "<td x:str></td>";
|
||||
continue;
|
||||
}
|
||||
$oObj->FireEventReadDetails(get_class($this));
|
||||
|
||||
switch ($sAttCode) {
|
||||
case 'id':
|
||||
|
||||
@@ -135,6 +135,11 @@ abstract class Trigger extends cmdbAbstractObject
|
||||
if ($oAction->IsActive()) {
|
||||
$oKPI = new ExecutionKPI();
|
||||
$aContextArgs['action->object()'] = $oAction;
|
||||
if (array_key_exists('this->object()', $aContextArgs)) {
|
||||
/** @var \DBObject $oObject */
|
||||
$oObject = $aContextArgs['this->object()'];
|
||||
$oObject->FireEventReadDetails(get_class($oAction));
|
||||
}
|
||||
$oAction->DoExecute($this, $aContextArgs);
|
||||
$oKPI->ComputeStatsForExtension($oAction, 'DoExecute');
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ class XMLBulkExport extends BulkExport
|
||||
}
|
||||
foreach ($aAuthorizedClasses as $sAlias => $sClassName) {
|
||||
$oObj = $aObjects[$sAlias];
|
||||
$oObj->FireEventReadDetails();
|
||||
$oObj->FireEventReadDetails(get_class($this));
|
||||
if (is_null($oObj)) {
|
||||
$sData .= "<$sClassName alias=\"$sAlias\" id=\"null\">\n";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user