mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
Migrate datamodel
This commit is contained in:
@@ -975,6 +975,18 @@
|
||||
</state>
|
||||
</states>
|
||||
</lifecycle>
|
||||
<event_listeners>
|
||||
<listener id="OnInsertRequested">
|
||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||
<callback>OnInsertRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnUpdateRequested">
|
||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||
<callback>OnUpdateRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="GetTicketRefFormat">
|
||||
<static>true</static>
|
||||
@@ -1015,28 +1027,26 @@
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnInsert">
|
||||
<method id="OnInsertRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[
|
||||
protected function OnInsert()
|
||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::OnInsert();
|
||||
$this->UpdateImpactedItems();
|
||||
$this->SetIfNull('creation_date', time());
|
||||
$this->SetIfNull('last_update', time());
|
||||
}]]>
|
||||
</code>
|
||||
</method>
|
||||
<method id="OnUpdate">
|
||||
<method id="OnUpdateRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[
|
||||
protected function OnUpdate()
|
||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::OnUpdate();
|
||||
$aChanges = $this->ListChanges();
|
||||
if (array_key_exists('functionalcis_list', $aChanges))
|
||||
{
|
||||
|
||||
@@ -512,6 +512,18 @@
|
||||
</state>
|
||||
</states>
|
||||
</lifecycle>
|
||||
<event_listeners>
|
||||
<listener id="OnInsertRequested">
|
||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||
<callback>OnInsertRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnUpdateRequested">
|
||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||
<callback>OnUpdateRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="GetTicketRefFormat">
|
||||
<static>true</static>
|
||||
@@ -566,27 +578,25 @@
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnInsert">
|
||||
<method id="OnInsertRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[
|
||||
protected function OnInsert()
|
||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::OnInsert();
|
||||
$this->UpdateImpactedItems();
|
||||
$this->SetIfNull('creation_date', time());
|
||||
$this->SetIfNull('last_update', time());
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnUpdate">
|
||||
<method id="OnUpdateRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[
|
||||
protected function OnUpdate()
|
||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::OnUpdate();
|
||||
$aChanges = $this->ListChanges();
|
||||
if (array_key_exists('functionalcis_list', $aChanges))
|
||||
{
|
||||
|
||||
@@ -1052,6 +1052,28 @@
|
||||
</state>
|
||||
</states>
|
||||
</lifecycle>
|
||||
<event_listeners>
|
||||
<listener id="OnInsertRequested">
|
||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||
<callback>OnInsertRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnUpdateRequested">
|
||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||
<callback>OnUpdateRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnComputeValues">
|
||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||
<callback>OnComputeValues</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnCheckToWrite">
|
||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||
<callback>OnCheckToWrite</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="GetTicketRefFormat">
|
||||
<static>true</static>
|
||||
@@ -1122,13 +1144,12 @@
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DoCheckToWrite">
|
||||
<method id="OnCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[public function DoCheckToWrite()
|
||||
<code><![CDATA[public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
if (!$this->IsNew() && ($this->Get('parent_incident_id') == $this->GetKey()))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::Format('Class:Incident/Error:CannotAssignParentIncidentIdToSelf');
|
||||
@@ -1177,17 +1198,15 @@
|
||||
return $iPriority;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputeValues">
|
||||
<method id="OnComputeValues">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ public function ComputeValues()
|
||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
|
||||
// Compute the priority of the ticket
|
||||
$this->Set('priority', $this->ComputePriority());
|
||||
|
||||
return parent::ComputeValues();
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DisplayBareRelations">
|
||||
@@ -1465,26 +1484,24 @@
|
||||
$this->UpdateImpactedItems();
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnInsert">
|
||||
<method id="OnInsertRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ protected function OnInsert()
|
||||
<code><![CDATA[ public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
|
||||
{
|
||||
parent::OnInsert();
|
||||
$this->ComputeImpactedItems();
|
||||
$this->SetIfNull('last_update', time());
|
||||
$this->SetIfNull('start_date', time());
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnUpdate">
|
||||
<method id="OnUpdateRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ protected function OnUpdate()
|
||||
<code><![CDATA[ public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::OnUpdate();
|
||||
$aChanges = $this->ListChanges();
|
||||
if (array_key_exists('functionalcis_list', $aChanges))
|
||||
{
|
||||
|
||||
@@ -423,6 +423,23 @@
|
||||
</state>
|
||||
</states>
|
||||
</lifecycle>
|
||||
<event_listeners>
|
||||
<listener id="OnInsertRequested">
|
||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||
<callback>OnInsertRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnUpdateRequested">
|
||||
<event>EVENT_SERVICE_DB_UPDATE_REQUESTED</event>
|
||||
<callback>OnUpdateRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnComputeValues">
|
||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||
<callback>OnComputeValues</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="GetTicketRefFormat">
|
||||
<static>true</static>
|
||||
@@ -520,31 +537,31 @@
|
||||
return $iPriority;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputeValues">
|
||||
<method id="OnComputeValues">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ public function ComputeValues()
|
||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
// Compute the priority of the ticket
|
||||
$this->Set('priority', $this->ComputePriority());
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnInsert">
|
||||
<method id="OnInsertRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ protected function OnInsert()
|
||||
<code><![CDATA[ public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
$this->SetIfNull('start_date', time());
|
||||
$this->SetIfNull('last_update', time());
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="OnUpdate">
|
||||
<method id="OnUpdateRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ protected function OnUpdate()
|
||||
<code><![CDATA[ public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
$this->Set('last_update', time());
|
||||
}]]></code>
|
||||
|
||||
@@ -1209,6 +1209,16 @@
|
||||
<callback>OnUpdateRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnComputeValues">
|
||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||
<callback>OnComputeValues</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnCheckToWrite">
|
||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||
<callback>OnCheckToWrite</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="GetTicketRefFormat">
|
||||
@@ -1294,13 +1304,12 @@
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DoCheckToWrite">
|
||||
<method id="OnCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[public function DoCheckToWrite()
|
||||
<code><![CDATA[public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::Format('Class:UserRequest/Error:CannotAssignParentRequestIdToSelf');
|
||||
@@ -1349,17 +1358,14 @@
|
||||
return $iPriority;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputeValues">
|
||||
<method id="OnComputeValues">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ public function ComputeValues()
|
||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
|
||||
// Compute the priority of the ticket
|
||||
$this->Set('priority', $this->ComputePriority());
|
||||
|
||||
return parent::ComputeValues();
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DisplayBareRelations">
|
||||
@@ -1551,10 +1557,10 @@
|
||||
</method>
|
||||
<method id="OnInsertRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[
|
||||
protected function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
public function OnInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
$this->ComputeImpactedItems();
|
||||
$this->SetIfNull('last_update', time());
|
||||
@@ -1563,10 +1569,10 @@
|
||||
</method>
|
||||
<method id="OnUpdateRequested">
|
||||
<static>false</static>
|
||||
<access>protected</access>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[
|
||||
protected function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
public function OnUpdateRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
$aChanges = $this->ListChanges();
|
||||
if (array_key_exists('functionalcis_list', $aChanges))
|
||||
|
||||
@@ -1242,6 +1242,16 @@
|
||||
<callback>OnUpdateRequested</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnComputeValues">
|
||||
<event>EVENT_SERVICE_DB_COMPUTE_VALUES</event>
|
||||
<callback>OnComputeValues</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
<listener id="OnCheckToWrite">
|
||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||
<callback>OnCheckToWrite</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="GetTicketRefFormat">
|
||||
@@ -1327,13 +1337,12 @@
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DoCheckToWrite">
|
||||
<method id="OnCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[public function DoCheckToWrite()
|
||||
<code><![CDATA[public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::Format('Class:UserRequest/Error:CannotAssignParentRequestIdToSelf');
|
||||
@@ -1383,11 +1392,11 @@
|
||||
return $iPriority;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputeValues">
|
||||
<method id="OnComputeValues">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ public function ComputeValues()
|
||||
<code><![CDATA[ public function OnComputeValues(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
// Compute the priority of the ticket
|
||||
$this->Set('priority', $this->ComputePriority());
|
||||
@@ -1403,8 +1412,6 @@
|
||||
$this->Set('request_type', $sType);
|
||||
}
|
||||
}
|
||||
|
||||
return parent::ComputeValues();
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DisplayBareRelations">
|
||||
|
||||
@@ -1587,15 +1587,20 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<duplicates>true</duplicates>
|
||||
</field>
|
||||
</fields>
|
||||
<event_listeners>
|
||||
<listener id="OnCheckToWrite">
|
||||
<event>EVENT_SERVICE_DB_CHECK_TO_WRITE</event>
|
||||
<callback>OnCheckToWrite</callback>
|
||||
<priority>0</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="DoCheckToWrite">
|
||||
<method id="OnCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<code><![CDATA[
|
||||
public function DoCheckToWrite()
|
||||
public function OnCheckToWrite(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
|
||||
$aCustomerContracts = $this->Get("customercontracts_list");
|
||||
foreach ($aCustomerContracts as $sAttCode => $oCustomerContracts)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user