Merge remote-tracking branch 'origin/support/3.1' into develop

This commit is contained in:
Eric Espie
2024-02-27 17:40:56 +01:00
4 changed files with 86 additions and 17 deletions

View File

@@ -269,16 +269,15 @@
<description>An attachment has been added to an object</description>
<replaces>Attachment::AfterUpdate</replaces>
<sources>
<source id="Attachment">Attachment</source>
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
</sources>
<event_data>
<event_datum id="object">
<description>The attachment updated</description>
<description>The object where the attachment is added</description>
<type>DBObject</type>
</event_datum>
<event_datum id="target_object">
<description>The object to which the attachment is linked</description>
<event_datum id="attachment">
<description>The attachment added to the objet</description>
<type>DBObject</type>
</event_datum>
<event_datum id="debug_info">
@@ -291,16 +290,15 @@
<description>An attachment has been removed from an object</description>
<replaces>Attachment::AfterUpdate</replaces>
<sources>
<source id="Attachment">Attachment</source>
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
</sources>
<event_data>
<event_datum id="object">
<description>The attachment updated</description>
<description>The object where the attachment is removed</description>
<type>DBObject</type>
</event_datum>
<event_datum id="target_object">
<description>The object to which the attachment is linked</description>
<event_datum id="attachment">
<description>The attachment removed</description>
<type>DBObject</type>
</event_datum>
<event_datum id="debug_info">

View File

@@ -264,7 +264,6 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
else
{
$oAttachmentsRenderer->RenderViewAttachmentsList();
}
}
@@ -293,8 +292,8 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
// Remove attachments that are no longer attached to the current object
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentIds))
{
$aData = ['target_object' => $oObject];
$oAttachment->FireEvent(EVENT_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
$aData = ['attachment' => $oAttachment];
$oObject->FireEvent(EVENT_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
$oAttachment->DBDelete();
$aActions[] = self::GetActionChangeOp($oAttachment, false /* false => deletion */);
}
@@ -322,8 +321,8 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
$oAttachment->DBUpdate();
// temporary attachment confirmed, list it in the history
$aActions[] = self::GetActionChangeOp($oAttachment, true /* true => creation */);
$aData = ['target_object' => $oObject];
$oAttachment->FireEvent(EVENT_ADD_ATTACHMENT_TO_OBJECT, $aData);
$aData = ['attachment' => $oAttachment];
$oObject->FireEvent(EVENT_ADD_ATTACHMENT_TO_OBJECT, $aData);
}
}
if (count($aActions) > 0)