Merge remote-tracking branch 'origin/support/3.1' into develop

This commit is contained in:
Eric Espie
2023-12-12 17:16:58 +01:00
5 changed files with 20 additions and 12 deletions

View File

@@ -1493,10 +1493,9 @@
<code><![CDATA[ protected function OnInsert()
{
parent::OnInsert();
$this->ComputeImpactedItems();
$this->SetIfNull('last_update', time());
$this->SetIfNull('start_date', time());
parent::OnInsert();
$this->SetIfNull('last_update', time());
$this->SetIfNull('start_date', time());
}]]></code>
</method>
<method id="OnUpdate">

View File

@@ -1567,7 +1567,6 @@
protected function OnInsert()
{
parent::OnInsert();
$this->ComputeImpactedItems();
$this->SetIfNull('last_update', time());
$this->SetIfNull('start_date', time());
}]]></code>

View File

@@ -1608,11 +1608,9 @@
<code><![CDATA[
protected function OnInsert()
{
parent::OnInsert();
$this->ComputeImpactedItems();
$this->SetIfNull('last_update', time());
$this->SetIfNull('start_date', time());
parent::OnInsert();
$this->SetIfNull('last_update', time());
$this->SetIfNull('start_date', time());
}]]></code>
</method>
<method id="OnUpdate">

View File

@@ -224,11 +224,22 @@
<event_listeners>
<event_listener id="UpdateImpactAnalysis">
<event>EVENT_DB_LINKS_CHANGED</event>
<callback>UpdateImpactedItems</callback>
<callback>OnLinksChangedTicket</callback>
<rank>0</rank>
</event_listener>
</event_listeners>
<methods>
<method id="OnLinksChangedTicket">
<static>false</static>
<access>public</access>
<type>EventListener</type>
<code><![CDATA[
public function OnLinksChangedTicket(Combodo\iTop\Service\Events\EventData $oEventData)
{
$this->UpdateImpactedItems();
}
]]></code>
</method>
<method id="DBInsertNoReload">
<static>false</static>
<access>public</access>

View File

@@ -83,6 +83,7 @@ class TransactionsTest extends ItopTestCase
$oLinkSet = $oTicket->Get('contacts_list');
$oLinkSet->AddItem(MetaModel::NewObject('lnkContactToTicket', ['contact_id' => 6]));
$oLinkSet->AddItem(MetaModel::NewObject('lnkContactToTicket', ['contact_id' => 7]));
$oTicket->Set('contacts_list', $oLinkSet);
$this->oMySQLiMock->SetFailAt($iFailAt);
$this->debug("---> DBInsert()");
@@ -188,7 +189,7 @@ class TransactionsTest extends ItopTestCase
$oLinkSet = $oTicket->Get('contacts_list');
$oLinkSet->AddItem(MetaModel::NewObject('lnkContactToTicket', ['contact_id' => 6]));
$oLinkSet->AddItem(MetaModel::NewObject('lnkContactToTicket', ['contact_id' => 7]));
//$oTicket->Set('contacts_list', $oLinkSet);
$oTicket->Set('contacts_list', $oLinkSet);
$this->oMySQLiMock->SetShowRequest(false);
$oTicket->DBWrite();