mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
N°2163 DB*Tracked methods : modifications after review with Romain
Previous commit : 24eb82d1
Use \CMDBObject::SetTrackInfo
Move \CMDBObject::SetCurrentChange calls at the top most level of the stacks
Restore old behaviors that were removed in previous commit
This commit is contained in:
@@ -50,21 +50,13 @@ class TicketsInstaller extends ModuleInstallerAPI
|
||||
public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
|
||||
{
|
||||
// Delete all Triggers corresponding to a no more valid class
|
||||
CMDBObject::SetTrackInfo('Uninstallation');
|
||||
$oSearch = new DBObjectSearch('TriggerOnObject');
|
||||
$oSet = new DBObjectSet($oSearch);
|
||||
$oChange = null;
|
||||
while($oTrigger = $oSet->Fetch())
|
||||
{
|
||||
if (!MetaModel::IsValidClass($oTrigger->Get('target_class')))
|
||||
{
|
||||
if ($oChange == null)
|
||||
{
|
||||
// Create the change for its first use
|
||||
$oChange = new CMDBChange;
|
||||
$oChange->Set("date", time());
|
||||
$oChange->Set("userinfo", "Uninstallation");
|
||||
}
|
||||
$oTrigger::SetCurrentChange($oChange);
|
||||
$oTrigger->DBDelete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user