mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
refactor Event Listeners
This commit is contained in:
@@ -976,14 +976,14 @@
|
|||||||
</states>
|
</states>
|
||||||
</lifecycle>
|
</lifecycle>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnInsertRequested">
|
<listener id="OnChangeInsertRequested">
|
||||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
<callback>OnInsertRequested</callback>
|
<callback>OnChangeInsertRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnUpdateRequested">
|
<listener id="OnChangeUpdateRequested">
|
||||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||||
<callback>OnUpdateRequested</callback>
|
<callback>OnChangeUpdateRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
@@ -1027,12 +1027,12 @@
|
|||||||
return true;
|
return true;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnInsertRequested">
|
<method id="OnChangeInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnChangeInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$this->UpdateImpactedItems();
|
$this->UpdateImpactedItems();
|
||||||
$this->SetIfNull('creation_date', time());
|
$this->SetIfNull('creation_date', time());
|
||||||
@@ -1040,12 +1040,12 @@
|
|||||||
}]]>
|
}]]>
|
||||||
</code>
|
</code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnUpdateRequested">
|
<method id="OnChangeUpdateRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnChangeUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$aChanges = $this->ListChanges();
|
$aChanges = $this->ListChanges();
|
||||||
if (array_key_exists('functionalcis_list', $aChanges))
|
if (array_key_exists('functionalcis_list', $aChanges))
|
||||||
|
|||||||
@@ -513,14 +513,14 @@
|
|||||||
</states>
|
</states>
|
||||||
</lifecycle>
|
</lifecycle>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnInsertRequested">
|
<listener id="OnChangeInsertRequested">
|
||||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
<callback>OnInsertRequested</callback>
|
<callback>OnChangeInsertRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnUpdateRequested">
|
<listener id="OnChangeUpdateRequested">
|
||||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||||
<callback>OnUpdateRequested</callback>
|
<callback>OnChangeUpdateRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
@@ -578,24 +578,24 @@
|
|||||||
return true;
|
return true;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnInsertRequested">
|
<method id="OnChangeInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnChangeInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$this->UpdateImpactedItems();
|
$this->UpdateImpactedItems();
|
||||||
$this->SetIfNull('creation_date', time());
|
$this->SetIfNull('creation_date', time());
|
||||||
$this->SetIfNull('last_update', time());
|
$this->SetIfNull('last_update', time());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnUpdateRequested">
|
<method id="OnChangeUpdateRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnChangeUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$aChanges = $this->ListChanges();
|
$aChanges = $this->ListChanges();
|
||||||
if (array_key_exists('functionalcis_list', $aChanges))
|
if (array_key_exists('functionalcis_list', $aChanges))
|
||||||
|
|||||||
@@ -1053,24 +1053,24 @@
|
|||||||
</states>
|
</states>
|
||||||
</lifecycle>
|
</lifecycle>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnInsertRequested">
|
<listener id="OnIncidentInsertRequested">
|
||||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
<callback>OnInsertRequested</callback>
|
<callback>OnIncidentInsertRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnUpdateRequested">
|
<listener id="OnIncidentUpdateRequested">
|
||||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||||
<callback>OnUpdateRequested</callback>
|
<callback>OnIncidentUpdateRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnComputeValues">
|
<listener id="OnIncidentComputeValues">
|
||||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||||
<callback>OnComputeValues</callback>
|
<callback>OnIncidentComputeValues</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnCheckToWrite">
|
<listener id="OnIncidentCheckToWrite">
|
||||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||||
<callback>OnCheckToWrite</callback>
|
<callback>OnIncidentCheckToWrite</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
@@ -1144,11 +1144,11 @@
|
|||||||
return true;
|
return true;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnCheckToWrite">
|
<method id="OnIncidentCheckToWrite">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[public function OnIncidentCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
if (!$this->IsNew() && ($this->Get('parent_incident_id') == $this->GetKey()))
|
if (!$this->IsNew() && ($this->Get('parent_incident_id') == $this->GetKey()))
|
||||||
{
|
{
|
||||||
@@ -1198,11 +1198,11 @@
|
|||||||
return $iPriority;
|
return $iPriority;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnComputeValues">
|
<method id="OnIncidentComputeValues">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnIncidentComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Compute the priority of the ticket
|
// Compute the priority of the ticket
|
||||||
@@ -1484,11 +1484,11 @@
|
|||||||
$this->UpdateImpactedItems();
|
$this->UpdateImpactedItems();
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnInsertRequested">
|
<method id="OnIncidentInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnIncidentInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
|
|
||||||
{
|
{
|
||||||
$this->ComputeImpactedItems();
|
$this->ComputeImpactedItems();
|
||||||
@@ -1496,11 +1496,11 @@
|
|||||||
$this->SetIfNull('start_date', time());
|
$this->SetIfNull('start_date', time());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnUpdateRequested">
|
<method id="OnIncidentUpdateRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnIncidentUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$aChanges = $this->ListChanges();
|
$aChanges = $this->ListChanges();
|
||||||
if (array_key_exists('functionalcis_list', $aChanges))
|
if (array_key_exists('functionalcis_list', $aChanges))
|
||||||
|
|||||||
@@ -424,19 +424,19 @@
|
|||||||
</states>
|
</states>
|
||||||
</lifecycle>
|
</lifecycle>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnInsertRequested">
|
<listener id="OnProblemInsertRequested">
|
||||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
<callback>OnInsertRequested</callback>
|
<callback>OnProblemInsertRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnUpdateRequested">
|
<listener id="OnProblemUpdateRequested">
|
||||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||||
<callback>OnUpdateRequested</callback>
|
<callback>OnProblemUpdateRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnComputeValues">
|
<listener id="OnProblemComputeValues">
|
||||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||||
<callback>OnComputeValues</callback>
|
<callback>OnProblemComputeValues</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
@@ -537,31 +537,31 @@
|
|||||||
return $iPriority;
|
return $iPriority;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnComputeValues">
|
<method id="OnProblemComputeValues">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnProblemComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
// Compute the priority of the ticket
|
// Compute the priority of the ticket
|
||||||
$this->Set('priority', $this->ComputePriority());
|
$this->Set('priority', $this->ComputePriority());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnInsertRequested">
|
<method id="OnProblemInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnProblemInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$this->SetIfNull('start_date', time());
|
$this->SetIfNull('start_date', time());
|
||||||
$this->SetIfNull('last_update', time());
|
$this->SetIfNull('last_update', time());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnUpdateRequested">
|
<method id="OnProblemUpdateRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnProblemUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$this->Set('last_update', time());
|
$this->Set('last_update', time());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
|
|||||||
@@ -1199,24 +1199,24 @@
|
|||||||
</states>
|
</states>
|
||||||
</lifecycle>
|
</lifecycle>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnInsertRequested">
|
<listener id="OnUserRequestInsertRequested">
|
||||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
<callback>OnInsertRequested</callback>
|
<callback>OnUserRequestInsertRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnUpdateRequested">
|
<listener id="OnUserRequestUpdateRequested">
|
||||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||||
<callback>OnUpdateRequested</callback>
|
<callback>OnUserRequestUpdateRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnComputeValues">
|
<listener id="OnUserRequestComputeValues">
|
||||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||||
<callback>OnComputeValues</callback>
|
<callback>OnUserRequestComputeValues</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnCheckToWrite">
|
<listener id="OnUserRequestCheckToWrite">
|
||||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||||
<callback>OnCheckToWrite</callback>
|
<callback>OnUserRequestCheckToWrite</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
@@ -1304,11 +1304,11 @@
|
|||||||
return true;
|
return true;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnCheckToWrite">
|
<method id="OnUserRequestCheckToWrite">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[public function OnUserRequestCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
||||||
{
|
{
|
||||||
@@ -1358,11 +1358,11 @@
|
|||||||
return $iPriority;
|
return $iPriority;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnComputeValues">
|
<method id="OnUserRequestComputeValues">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnUserRequestComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
// Compute the priority of the ticket
|
// Compute the priority of the ticket
|
||||||
$this->Set('priority', $this->ComputePriority());
|
$this->Set('priority', $this->ComputePriority());
|
||||||
@@ -1555,24 +1555,24 @@
|
|||||||
$this->UpdateImpactedItems();
|
$this->UpdateImpactedItems();
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnInsertRequested">
|
<method id="OnUserRequestInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnUserRequestInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$this->ComputeImpactedItems();
|
$this->ComputeImpactedItems();
|
||||||
$this->SetIfNull('last_update', time());
|
$this->SetIfNull('last_update', time());
|
||||||
$this->SetIfNull('start_date', time());
|
$this->SetIfNull('start_date', time());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnUpdateRequested">
|
<method id="OnUserRequestUpdateRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnUserRequestUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$aChanges = $this->ListChanges();
|
$aChanges = $this->ListChanges();
|
||||||
if (array_key_exists('functionalcis_list', $aChanges))
|
if (array_key_exists('functionalcis_list', $aChanges))
|
||||||
|
|||||||
@@ -1232,24 +1232,24 @@
|
|||||||
</states>
|
</states>
|
||||||
</lifecycle>
|
</lifecycle>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnInsertRequested">
|
<listener id="OnUserRequestInsertRequested">
|
||||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
<callback>OnInsertRequested</callback>
|
<callback>OnUserRequestInsertRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnUpdateRequested">
|
<listener id="OnUserRequestUpdateRequested">
|
||||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||||
<callback>OnUpdateRequested</callback>
|
<callback>OnUserRequestUpdateRequested</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnComputeValues">
|
<listener id="OnUserRequestComputeValues">
|
||||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||||
<callback>OnComputeValues</callback>
|
<callback>OnUserRequestComputeValues</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
<listener id="OnCheckToWrite">
|
<listener id="OnUserRequestCheckToWrite">
|
||||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||||
<callback>OnCheckToWrite</callback>
|
<callback>OnUserRequestCheckToWrite</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
@@ -1337,11 +1337,11 @@
|
|||||||
return true;
|
return true;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnCheckToWrite">
|
<method id="OnUserRequestCheckToWrite">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[public function OnUserRequestCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
||||||
{
|
{
|
||||||
@@ -1392,11 +1392,11 @@
|
|||||||
return $iPriority;
|
return $iPriority;
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnComputeValues">
|
<method id="OnUserRequestComputeValues">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
<code><![CDATA[ public function OnUserRequestComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
// Compute the priority of the ticket
|
// Compute the priority of the ticket
|
||||||
$this->Set('priority', $this->ComputePriority());
|
$this->Set('priority', $this->ComputePriority());
|
||||||
@@ -1601,12 +1601,12 @@
|
|||||||
$this->UpdateImpactedItems();
|
$this->UpdateImpactedItems();
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnInsertRequested">
|
<method id="OnUserRequestInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Internal</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnUserRequestInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$this->ComputeImpactedItems();
|
$this->ComputeImpactedItems();
|
||||||
|
|
||||||
@@ -1614,12 +1614,12 @@
|
|||||||
$this->SetIfNull('start_date', time());
|
$this->SetIfNull('start_date', time());
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="OnUpdateRequested">
|
<method id="OnUserRequestUpdateRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Internal</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
public function OnUserRequestUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$aChanges = $this->ListChanges();
|
$aChanges = $this->ListChanges();
|
||||||
if (array_key_exists('functionalcis_list', $aChanges))
|
if (array_key_exists('functionalcis_list', $aChanges))
|
||||||
|
|||||||
@@ -1588,18 +1588,18 @@ public function PrefillSearchForm(&$aContextParam)
|
|||||||
</field>
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
<event_listeners>
|
<event_listeners>
|
||||||
<listener id="OnCheckToWrite">
|
<listener id="OnSLACheckToWrite">
|
||||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||||
<callback>OnCheckToWrite</callback>
|
<callback>OnSLACheckToWrite</callback>
|
||||||
<priority>0</priority>
|
<priority>0</priority>
|
||||||
</listener>
|
</listener>
|
||||||
</event_listeners>
|
</event_listeners>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="OnCheckToWrite">
|
<method id="OnSLACheckToWrite">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
public function OnSLACheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$aCustomerContracts = $this->Get("customercontracts_list");
|
$aCustomerContracts = $this->Get("customercontracts_list");
|
||||||
foreach ($aCustomerContracts as $sAttCode => $oCustomerContracts)
|
foreach ($aCustomerContracts as $sAttCode => $oCustomerContracts)
|
||||||
|
|||||||
@@ -214,19 +214,24 @@
|
|||||||
<count_max>0</count_max>
|
<count_max>0</count_max>
|
||||||
</field>
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
<methods>
|
<event_listeners>
|
||||||
<method id="DBInsertNoReload">
|
<listener id="OnTicketInsertRequested">
|
||||||
|
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||||
|
<callback>OnTicketInsertRequested</callback>
|
||||||
|
<priority>-10</priority>
|
||||||
|
</listener>
|
||||||
|
</event_listeners>
|
||||||
|
<methods>
|
||||||
|
<method id="OnTicketInsertRequested">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>Overload-DBObject</type>
|
<type>Overload-ExNihilo</type>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public function DBInsertNoReload()
|
public function OnTicketInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||||
{
|
{
|
||||||
$iNextId = ItopCounter::IncClass(get_class($this));
|
$iNextId = ItopCounter::IncClass(get_class($this));
|
||||||
$sRef = $this->MakeTicketRef($iNextId);
|
$sRef = $this->MakeTicketRef($iNextId);
|
||||||
$this->SetIfNull('ref', $sRef);
|
$this->SetIfNull('ref', $sRef);
|
||||||
$iKey = parent::DBInsertNoReload();
|
|
||||||
return $iKey;
|
|
||||||
}
|
}
|
||||||
]]></code>
|
]]></code>
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
@@ -283,22 +283,24 @@ function DisplayEvents(WebPage $oPage, $sClass)
|
|||||||
$oTable = DataTableUIBlockFactory::MakeForStaticData(Dict::S('UI:Schema:Events:Defined'), $aColumns, $aRows);
|
$oTable = DataTableUIBlockFactory::MakeForStaticData(Dict::S('UI:Schema:Events:Defined'), $aColumns, $aRows);
|
||||||
$oPage->AddSubBlock($oTable);
|
$oPage->AddSubBlock($oTable);
|
||||||
|
|
||||||
$aClasses = [];
|
|
||||||
foreach (MetaModel::EnumChildClasses($sClass, ENUM_CHILD_CLASSES_ALL) as $sChildClass) {
|
|
||||||
if (MetaModel::IsAbstract($sChildClass)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$aClasses[] = $sChildClass;
|
|
||||||
}
|
|
||||||
$aSources = [];
|
$aSources = [];
|
||||||
foreach ($aClasses as $sChildClass) {
|
if (MetaModel::IsAbstract($sClass)) {
|
||||||
$oObject = MetaModel::NewObject($sChildClass);
|
foreach (MetaModel::EnumChildClasses($sClass, ENUM_CHILD_CLASSES_ALL) as $sChildClass) {
|
||||||
$aSources[] = $oObject->GetObjectUniqId();
|
if (!MetaModel::IsAbstract($sChildClass)) {
|
||||||
foreach (MetaModel::EnumParentClasses($sChildClass, ENUM_PARENT_CLASSES_ALL, false) as $sParentClass) {
|
$oObject = MetaModel::NewObject($sChildClass);
|
||||||
if (!in_array($sParentClass, $aSources)) {
|
$aSources[] = $oObject->GetObjectUniqId();
|
||||||
$aSources[] = $sParentClass;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach (MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL, false) as $sParentClass) {
|
||||||
|
$aSources[] = $sParentClass;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$oObject = MetaModel::NewObject($sClass);
|
||||||
|
$aSources[] = $oObject->GetObjectUniqId();
|
||||||
|
foreach (MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL, false) as $sParentClass) {
|
||||||
|
$aSources[] = $sParentClass;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$aListeners = [];
|
$aListeners = [];
|
||||||
foreach (array_keys($aEvents) as $sEvent) {
|
foreach (array_keys($aEvents) as $sEvent) {
|
||||||
@@ -321,9 +323,19 @@ function DisplayEvents(WebPage $oPage, $sClass)
|
|||||||
'module' => ['label' => 'Module'],
|
'module' => ['label' => 'Module'],
|
||||||
];
|
];
|
||||||
$aRows = [];
|
$aRows = [];
|
||||||
|
$oReflectionClass = new ReflectionClass($sClass);
|
||||||
foreach ($aListeners as $aListener) {
|
foreach ($aListeners as $aListener) {
|
||||||
if (is_object($aListener['callback'][0])) {
|
if (is_object($aListener['callback'][0])) {
|
||||||
$sListener = get_class($aListener['callback'][0]).'->'.$aListener['callback'][1].'(Combodo\iTop\Service\EventData $oEventData)';
|
$sListenerClass = $sClass;
|
||||||
|
if ($aListener['callback'][0] != $sClass) {
|
||||||
|
$oListenerReflectionClass = new ReflectionClass(get_class($aListener['callback'][0]));
|
||||||
|
if (!$oListenerReflectionClass->isSubclassOf($sClass)) {
|
||||||
|
$sListenerClass = get_class($aListener['callback'][0]);
|
||||||
|
} elseif (!$oReflectionClass->hasMethod($aListener['callback'][1])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sListener = $sListenerClass.'->'.$aListener['callback'][1].'(Combodo\iTop\Service\EventData $oEventData)';
|
||||||
} else {
|
} else {
|
||||||
$sListener = $aListener['callback'][0].'::'.$aListener['callback'][1].'(Combodo\iTop\Service\EventData $oEventData)';
|
$sListener = $aListener['callback'][0].'::'.$aListener['callback'][1].'(Combodo\iTop\Service\EventData $oEventData)';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user