diff --git a/datamodels/2.x/itop-tickets/data/en_us.data.itop-tickets.xml b/datamodels/2.x/itop-tickets/data/en_us.data.itop-tickets.xml index 932850f64..31674ca46 100644 --- a/datamodels/2.x/itop-tickets/data/en_us.data.itop-tickets.xml +++ b/datamodels/2.x/itop-tickets/data/en_us.data.itop-tickets.xml @@ -7,7 +7,6 @@ SELECT Person WHERE id=:this->agent_id id,email QueryOQL - Agent of the Ticket Agent of the Ticket unless the agent himself triggered the notification @@ -18,7 +17,6 @@ SELECT Person WHERE id=:this->agent_id AND id != :current_contact_id id,email QueryOQL - Agent of the Ticket unless the agent himself triggered the notification Caller and Contacts linked to the Ticket @@ -30,7 +28,6 @@ id,email QueryOQL - Caller and Contacts linked to the Ticket Caller of the Ticket @@ -39,7 +36,6 @@ SELECT Person WHERE id=:this->caller_id id,email QueryOQL - Caller of the Ticket Contacts linked to the Ticket @@ -48,7 +44,6 @@ SELECT Contact AS C JOIN lnkContactToTicket AS L ON L.contact_id=C.id WHERE L.ticket_id=:this->id id,email QueryOQL - Contacts linked to the Ticket Manager of the Ticket caller @@ -57,7 +52,6 @@ SELECT Person AS manager JOIN Person AS employee ON employee.manager_id = manager.id WHERE employee.id=:this->caller_id id,email QueryOQL - Manager of the Ticket caller Person who triggered the notification @@ -68,7 +62,6 @@ SELECT Person WHERE id = :current_contact_id id,email QueryOQL - Person who triggered the notification Team members of the Ticket @@ -79,7 +72,6 @@ id,email QueryOQL - Team members of the Ticket Team members of the Ticket other than the agent @@ -92,7 +84,6 @@ id,email QueryOQL - Team members of the Ticket other than the agent Team of the Ticket @@ -101,6 +92,5 @@ SELECT Team WHERE id = :this->team_id id,email QueryOQL - Team of the Ticket diff --git a/datamodels/2.x/itop-tickets/module.itop-tickets.php b/datamodels/2.x/itop-tickets/module.itop-tickets.php index eab6932eb..a9d50b65a 100755 --- a/datamodels/2.x/itop-tickets/module.itop-tickets.php +++ b/datamodels/2.x/itop-tickets/module.itop-tickets.php @@ -73,20 +73,29 @@ class TicketsInstaller extends ModuleInstallerAPI // Without test, new entries added to the data files, would be automatically loaded if (($sPreviousVersion === '') || (version_compare($sPreviousVersion, $sCurrentVersion, '<') - && version_compare($sPreviousVersion, '3.0.1', '<'))) { + && version_compare($sPreviousVersion, '3.0.0', '<'))) { $oDataLoader = new XMLDataLoader(); CMDBObject::SetTrackInfo("Initialization"); $oMyChange = CMDBObject::GetCurrentChange(); - $sFileName = ''; - $oFileConfig = new Config(APPCONF.'production/'.ITOP_CONFIG_FILE); - if (is_object($oFileConfig)) - { - $sLang = str_replace(' ', '_', strtolower($oFileConfig->GetDefaultLanguage())); - $sFileName = dirname(__FILE__)."/data/{$sLang}.data.itop-tickets.xml"; - SetupLog::Info("Searching file: $sFileName"); + $sLang = null; + // - Try to get app. language from configuration fil (app. upgrade) + $sConfigFileName = APPCONF.'production/'.ITOP_CONFIG_FILE; + if (file_exists($sConfigFileName)) { + $oFileConfig = new Config($sConfigFileName); + if (is_object($oFileConfig)) { + $sLang = str_replace(' ', '_', strtolower($oFileConfig->GetDefaultLanguage())); + } } + + // - I still no language, get the default one + if (null === $sLang) { + $sLang = str_replace(' ', '_', strtolower($oConfiguration->GetDefaultLanguage())); + } + + $sFileName = dirname(__FILE__)."/data/{$sLang}.data.itop-tickets.xml"; + SetupLog::Info("Searching file: $sFileName"); if (!file_exists($sFileName)) { $sFileName = dirname(__FILE__)."/data/en_us.data.itop-tickets.xml"; }