mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°7294 - EVENT_ADD_ATTACHMENT_TO_OBJECT not triggered
This commit is contained in:
@@ -265,6 +265,23 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ObjectFormManager::FinalizeAttachments() for the portal version
|
||||
*
|
||||
* @param $oObject
|
||||
* @param $oChange
|
||||
*
|
||||
* @return void
|
||||
* @throws \ArchivedObjectException
|
||||
* @throws \CoreCannotSaveObjectException
|
||||
* @throws \CoreException
|
||||
* @throws \CoreUnexpectedValue
|
||||
* @throws \DeleteException
|
||||
* @throws \MySQLException
|
||||
* @throws \MySQLHasGoneAwayException
|
||||
* @throws \OQLException
|
||||
*/
|
||||
protected static function UpdateAttachments($oObject, $oChange = null)
|
||||
{
|
||||
self::$m_bIsModified = false;
|
||||
|
||||
@@ -1454,6 +1454,8 @@ class ObjectFormManager extends FormManager
|
||||
// Remove attachments that are no longer attached to the current object
|
||||
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentsIds))
|
||||
{
|
||||
$aData = ['attachment' => $oAttachment];
|
||||
$this->oObject->FireEvent(EVENT_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
|
||||
$oAttachment->DBDelete();
|
||||
$aActions[] = self::GetAttachmentActionChangeOp($oAttachment, false);
|
||||
}
|
||||
@@ -1478,6 +1480,8 @@ class ObjectFormManager extends FormManager
|
||||
$oAttachment->Set('temp_id', '');
|
||||
$oAttachment->DBUpdate();
|
||||
$aActions[] = self::GetAttachmentActionChangeOp($oAttachment, true);
|
||||
$aData = ['attachment' => $oAttachment];
|
||||
$this->oObject->FireEvent(EVENT_ADD_ATTACHMENT_TO_OBJECT, $aData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user