mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Attachments events
This commit is contained in:
@@ -203,40 +203,6 @@
|
|||||||
}
|
}
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="EventUpdateAfter">
|
|
||||||
<comment> /**
|
|
||||||
* @param array $aEventData
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @throws \CoreException
|
|
||||||
*/
|
|
||||||
</comment>
|
|
||||||
<static>false</static>
|
|
||||||
<access>protected</access>
|
|
||||||
<type>Overload-ExNihilo</type>
|
|
||||||
<code><![CDATA[
|
|
||||||
final protected function EventUpdateAfter(array $aEventData)
|
|
||||||
{
|
|
||||||
$this->FireEvent(EVENT_SERVICE_ATTACHMENT_AFTER_UPDATE);
|
|
||||||
}
|
|
||||||
]]></code>
|
|
||||||
</method>
|
|
||||||
<method id="EventDeleteAfter">
|
|
||||||
<comment> /**
|
|
||||||
* @return void
|
|
||||||
* @throws \CoreException
|
|
||||||
*/
|
|
||||||
</comment>
|
|
||||||
<static>false</static>
|
|
||||||
<access>protected</access>
|
|
||||||
<type>Overload-ExNihilo</type>
|
|
||||||
<code><![CDATA[
|
|
||||||
final protected function EventDeleteAfter()
|
|
||||||
{
|
|
||||||
$this->FireEvent(EVENT_SERVICE_ATTACHMENT_AFTER_DELETE);
|
|
||||||
}
|
|
||||||
]]></code>
|
|
||||||
</method>
|
|
||||||
</methods>
|
</methods>
|
||||||
<presentation>
|
<presentation>
|
||||||
<details>
|
<details>
|
||||||
@@ -288,8 +254,8 @@
|
|||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
<events>
|
<events>
|
||||||
<event id="EVENT_SERVICE_ATTACHMENT_AFTER_UPDATE" _delta="define">
|
<event id="EVENT_SERVICE_ADD_ATTACHMENT_TO_OBJECT" _delta="define">
|
||||||
<description>An attachment has been updated in database.</description>
|
<description>An attachment has been added to an object</description>
|
||||||
<replaces>Attachment::AfterUpdate</replaces>
|
<replaces>Attachment::AfterUpdate</replaces>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="Attachment">Attachment</source>
|
<source id="Attachment">Attachment</source>
|
||||||
@@ -299,9 +265,9 @@
|
|||||||
<description>The attachment updated</description>
|
<description>The attachment updated</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="changes">
|
<event_datum id="target_object">
|
||||||
<description>Array of all the attributes changed</description>
|
<description>The object to which the attachment is linked</description>
|
||||||
<type>array</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
<description>Debug string</description>
|
<description>Debug string</description>
|
||||||
@@ -309,15 +275,19 @@
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_SERVICE_ATTACHMENT_AFTER_DELETE" _delta="define">
|
<event id="EVENT_SERVICE_REMOVE_ATTACHMENT_FROM_OBJECT" _delta="define">
|
||||||
<description>An attachment has been deleted from database.</description>
|
<description>An attachment has been removed from an object</description>
|
||||||
<replaces>Attachment::AfterDelete</replaces>
|
<replaces>Attachment::AfterUpdate</replaces>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="Attachment">Attachment</source>
|
<source id="Attachment">Attachment</source>
|
||||||
</sources>
|
</sources>
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="object">
|
<event_datum id="object">
|
||||||
<description>The attachment deleted</description>
|
<description>The attachment updated</description>
|
||||||
|
<type>DBObject</type>
|
||||||
|
</event_datum>
|
||||||
|
<event_datum id="target_object">
|
||||||
|
<description>The object to which the attachment is linked</description>
|
||||||
<type>DBObject</type>
|
<type>DBObject</type>
|
||||||
</event_datum>
|
</event_datum>
|
||||||
<event_datum id="debug_info">
|
<event_datum id="debug_info">
|
||||||
|
|||||||
@@ -304,6 +304,8 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
|
|||||||
// Remove attachments that are no longer attached to the current object
|
// Remove attachments that are no longer attached to the current object
|
||||||
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentIds))
|
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentIds))
|
||||||
{
|
{
|
||||||
|
$aData = ['target_object' => $oObject];
|
||||||
|
$oAttachment->FireEvent(EVENT_SERVICE_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
|
||||||
$oAttachment->DBDelete();
|
$oAttachment->DBDelete();
|
||||||
$aActions[] = self::GetActionChangeOp($oAttachment, false /* false => deletion */);
|
$aActions[] = self::GetActionChangeOp($oAttachment, false /* false => deletion */);
|
||||||
}
|
}
|
||||||
@@ -332,6 +334,8 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
|
|||||||
$oAttachment->DBUpdate();
|
$oAttachment->DBUpdate();
|
||||||
// temporary attachment confirmed, list it in the history
|
// temporary attachment confirmed, list it in the history
|
||||||
$aActions[] = self::GetActionChangeOp($oAttachment, true /* true => creation */);
|
$aActions[] = self::GetActionChangeOp($oAttachment, true /* true => creation */);
|
||||||
|
$aData = ['target_object' => $oObject];
|
||||||
|
$oAttachment->FireEvent(EVENT_SERVICE_ADD_ATTACHMENT_TO_OBJECT, $aData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user