mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4756 - Ease extensibility for CRUD operations : Events renamed
This commit is contained in:
@@ -671,7 +671,7 @@
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_SERVICE_DOWNLOAD_DOCUMENT" _delta="define">
|
<event id="EVENT_DOWNLOAD_DOCUMENT" _delta="define">
|
||||||
<description>A document has been downloaded from the GUI</description>
|
<description>A document has been downloaded from the GUI</description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="Document">Document</source>
|
<source id="Document">Document</source>
|
||||||
@@ -691,7 +691,7 @@
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_SERVICE_LOGIN" _delta="define">
|
<event id="EVENT_LOGIN" _delta="define">
|
||||||
<description>Inform the listeners about the connection states</description>
|
<description>Inform the listeners about the connection states</description>
|
||||||
<event_data>
|
<event_data>
|
||||||
<event_datum id="code">
|
<event_datum id="code">
|
||||||
|
|||||||
@@ -481,13 +481,13 @@ class LoginWebPage extends NiceWebPage
|
|||||||
$iResponse = $oLoginFSMExtensionInstance->LoginAction($sLoginState, $iErrorCode);
|
$iResponse = $oLoginFSMExtensionInstance->LoginAction($sLoginState, $iErrorCode);
|
||||||
if ($iResponse == self::LOGIN_FSM_RETURN)
|
if ($iResponse == self::LOGIN_FSM_RETURN)
|
||||||
{
|
{
|
||||||
EventService::FireEvent(new EventData(EVENT_SERVICE_LOGIN, null, ['code' => $iErrorCode, 'state' => $sLoginState]));
|
EventService::FireEvent(new EventData(EVENT_LOGIN, null, ['code' => $iErrorCode, 'state' => $sLoginState]));
|
||||||
Session::WriteClose();
|
Session::WriteClose();
|
||||||
return $iErrorCode; // Asked to exit FSM, generally login OK
|
return $iErrorCode; // Asked to exit FSM, generally login OK
|
||||||
}
|
}
|
||||||
if ($iResponse == self::LOGIN_FSM_ERROR)
|
if ($iResponse == self::LOGIN_FSM_ERROR)
|
||||||
{
|
{
|
||||||
EventService::FireEvent(new EventData(EVENT_SERVICE_LOGIN, null, ['code' => $iErrorCode, 'state' => $sLoginState]));
|
EventService::FireEvent(new EventData(EVENT_LOGIN, null, ['code' => $iErrorCode, 'state' => $sLoginState]));
|
||||||
$sLoginState = self::LOGIN_STATE_SET_ERROR; // Next state will be error
|
$sLoginState = self::LOGIN_STATE_SET_ERROR; // Next state will be error
|
||||||
// An error was detected, skip the other plugins turn
|
// An error was detected, skip the other plugins turn
|
||||||
break;
|
break;
|
||||||
@@ -501,7 +501,7 @@ class LoginWebPage extends NiceWebPage
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
EventService::FireEvent(new EventData(EVENT_SERVICE_LOGIN, null, ['state' => $_SESSION['login_state']]));
|
EventService::FireEvent(new EventData(EVENT_LOGIN, null, ['state' => $_SESSION['login_state']]));
|
||||||
IssueLog::Error($e->getTraceAsString());
|
IssueLog::Error($e->getTraceAsString());
|
||||||
static::ResetSession();
|
static::ResetSession();
|
||||||
die($e->getMessage());
|
die($e->getMessage());
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class ormDocument
|
|||||||
'object' => $oObj,
|
'object' => $oObj,
|
||||||
'document' => $oDocument,
|
'document' => $oDocument,
|
||||||
);
|
);
|
||||||
EventService::FireEvent(new EventData(EVENT_SERVICE_DOWNLOAD_DOCUMENT, $sClass, $aEventData));
|
EventService::FireEvent(new EventData(EVENT_DOWNLOAD_DOCUMENT, $sClass, $aEventData));
|
||||||
$oPage->TrashUnexpectedOutput();
|
$oPage->TrashUnexpectedOutput();
|
||||||
$oPage->SetContentType($oDocument->GetMimeType());
|
$oPage->SetContentType($oDocument->GetMimeType());
|
||||||
$oPage->SetContentDisposition($sContentDisposition,$oDocument->GetFileName());
|
$oPage->SetContentDisposition($sContentDisposition,$oDocument->GetFileName());
|
||||||
|
|||||||
@@ -256,7 +256,7 @@
|
|||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
<events>
|
<events>
|
||||||
<event id="EVENT_SERVICE_ADD_ATTACHMENT_TO_OBJECT" _delta="define">
|
<event id="EVENT_ADD_ATTACHMENT_TO_OBJECT" _delta="define">
|
||||||
<description>An attachment has been added to an object</description>
|
<description>An attachment has been added to an object</description>
|
||||||
<replaces>Attachment::AfterUpdate</replaces>
|
<replaces>Attachment::AfterUpdate</replaces>
|
||||||
<sources>
|
<sources>
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
</event_datum>
|
</event_datum>
|
||||||
</event_data>
|
</event_data>
|
||||||
</event>
|
</event>
|
||||||
<event id="EVENT_SERVICE_REMOVE_ATTACHMENT_FROM_OBJECT" _delta="define">
|
<event id="EVENT_REMOVE_ATTACHMENT_FROM_OBJECT" _delta="define">
|
||||||
<description>An attachment has been removed from an object</description>
|
<description>An attachment has been removed from an object</description>
|
||||||
<replaces>Attachment::AfterUpdate</replaces>
|
<replaces>Attachment::AfterUpdate</replaces>
|
||||||
<sources>
|
<sources>
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
|
|||||||
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentIds))
|
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentIds))
|
||||||
{
|
{
|
||||||
$aData = ['target_object' => $oObject];
|
$aData = ['target_object' => $oObject];
|
||||||
$oAttachment->FireEvent(EVENT_SERVICE_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
|
$oAttachment->FireEvent(EVENT_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
|
||||||
$oAttachment->DBDelete();
|
$oAttachment->DBDelete();
|
||||||
$aActions[] = self::GetActionChangeOp($oAttachment, false /* false => deletion */);
|
$aActions[] = self::GetActionChangeOp($oAttachment, false /* false => deletion */);
|
||||||
}
|
}
|
||||||
@@ -335,7 +335,7 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
|
|||||||
// 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];
|
$aData = ['target_object' => $oObject];
|
||||||
$oAttachment->FireEvent(EVENT_SERVICE_ADD_ATTACHMENT_TO_OBJECT, $aData);
|
$oAttachment->FireEvent(EVENT_ADD_ATTACHMENT_TO_OBJECT, $aData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<itop_design version="3.1">
|
<itop_design version="3.1">
|
||||||
<events>
|
<events>
|
||||||
<event id="EVENT_SERVICE_DISPLAY_OBJECT_DETAILS" _delta="define">
|
<event id="EVENT_DISPLAY_OBJECT_DETAILS" _delta="define">
|
||||||
<description>An object details is about to be displayed to a user</description>
|
<description>An object details is about to be displayed to a user</description>
|
||||||
<sources>
|
<sources>
|
||||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class ObjectController extends BrickController
|
|||||||
$sObjectClass = get_class($oObject);
|
$sObjectClass = get_class($oObject);
|
||||||
$sObjectId = $oObject->GetKey();
|
$sObjectId = $oObject->GetKey();
|
||||||
|
|
||||||
$oObject->FireEvent(EVENT_SERVICE_DISPLAY_OBJECT_DETAILS);
|
$oObject->FireEvent(EVENT_DISPLAY_OBJECT_DETAILS);
|
||||||
|
|
||||||
$aData = array('sMode' => 'view');
|
$aData = array('sMode' => 'view');
|
||||||
$aData['form'] = $oObjectFormHandler->HandleForm($oRequest, $aData['sMode'], $sObjectClass, $sObjectId);
|
$aData['form'] = $oObjectFormHandler->HandleForm($oRequest, $aData['sMode'], $sObjectClass, $sObjectId);
|
||||||
|
|||||||
Reference in New Issue
Block a user