mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°463 - Load localized Query Phrases at Setup (3)
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
<oql>SELECT Person WHERE id=:this->agent_id</oql>
|
<oql>SELECT Person WHERE id=:this->agent_id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Agent of the Ticket</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="4">
|
<QueryOQL alias="QueryOQL" id="4">
|
||||||
<name>Agent of the Ticket unless the agent himself triggered the notification</name>
|
<name>Agent of the Ticket unless the agent himself triggered the notification</name>
|
||||||
@@ -18,7 +17,6 @@
|
|||||||
<oql>SELECT Person WHERE id=:this->agent_id AND id != :current_contact_id</oql>
|
<oql>SELECT Person WHERE id=:this->agent_id AND id != :current_contact_id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Agent of the Ticket unless the agent himself triggered the notification</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="3">
|
<QueryOQL alias="QueryOQL" id="3">
|
||||||
<name>Caller and Contacts linked to the Ticket</name>
|
<name>Caller and Contacts linked to the Ticket</name>
|
||||||
@@ -30,7 +28,6 @@
|
|||||||
</oql>
|
</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Caller and Contacts linked to the Ticket</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="1">
|
<QueryOQL alias="QueryOQL" id="1">
|
||||||
<name>Caller of the Ticket</name>
|
<name>Caller of the Ticket</name>
|
||||||
@@ -39,7 +36,6 @@
|
|||||||
<oql>SELECT Person WHERE id=:this->caller_id</oql>
|
<oql>SELECT Person WHERE id=:this->caller_id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Caller of the Ticket</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="2">
|
<QueryOQL alias="QueryOQL" id="2">
|
||||||
<name>Contacts linked to the Ticket</name>
|
<name>Contacts linked to the Ticket</name>
|
||||||
@@ -48,7 +44,6 @@
|
|||||||
<oql>SELECT Contact AS C JOIN lnkContactToTicket AS L ON L.contact_id=C.id WHERE L.ticket_id=:this->id</oql>
|
<oql>SELECT Contact AS C JOIN lnkContactToTicket AS L ON L.contact_id=C.id WHERE L.ticket_id=:this->id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Contacts linked to the Ticket</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="7">
|
<QueryOQL alias="QueryOQL" id="7">
|
||||||
<name>Manager of the Ticket caller</name>
|
<name>Manager of the Ticket caller</name>
|
||||||
@@ -57,7 +52,6 @@
|
|||||||
<oql>SELECT Person AS manager JOIN Person AS employee ON employee.manager_id = manager.id WHERE employee.id=:this->caller_id</oql>
|
<oql>SELECT Person AS manager JOIN Person AS employee ON employee.manager_id = manager.id WHERE employee.id=:this->caller_id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Manager of the Ticket caller</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="9">
|
<QueryOQL alias="QueryOQL" id="9">
|
||||||
<name>Person who triggered the notification</name>
|
<name>Person who triggered the notification</name>
|
||||||
@@ -68,7 +62,6 @@
|
|||||||
<oql>SELECT Person WHERE id = :current_contact_id</oql>
|
<oql>SELECT Person WHERE id = :current_contact_id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Person who triggered the notification</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="6">
|
<QueryOQL alias="QueryOQL" id="6">
|
||||||
<name>Team members of the Ticket</name>
|
<name>Team members of the Ticket</name>
|
||||||
@@ -79,7 +72,6 @@
|
|||||||
</oql>
|
</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Team members of the Ticket</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="5">
|
<QueryOQL alias="QueryOQL" id="5">
|
||||||
<name>Team members of the Ticket other than the agent</name>
|
<name>Team members of the Ticket other than the agent</name>
|
||||||
@@ -92,7 +84,6 @@
|
|||||||
</oql>
|
</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Team members of the Ticket other than the agent</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
<QueryOQL alias="QueryOQL" id="10">
|
<QueryOQL alias="QueryOQL" id="10">
|
||||||
<name>Team of the Ticket</name>
|
<name>Team of the Ticket</name>
|
||||||
@@ -101,6 +92,5 @@
|
|||||||
<oql>SELECT Team WHERE id = :this->team_id</oql>
|
<oql>SELECT Team WHERE id = :this->team_id</oql>
|
||||||
<fields>id,email</fields>
|
<fields>id,email</fields>
|
||||||
<finalclass>QueryOQL</finalclass>
|
<finalclass>QueryOQL</finalclass>
|
||||||
<friendlyname>Team of the Ticket</friendlyname>
|
|
||||||
</QueryOQL>
|
</QueryOQL>
|
||||||
</Set>
|
</Set>
|
||||||
|
|||||||
@@ -73,20 +73,29 @@ class TicketsInstaller extends ModuleInstallerAPI
|
|||||||
// Without test, new entries added to the data files, would be automatically loaded
|
// Without test, new entries added to the data files, would be automatically loaded
|
||||||
if (($sPreviousVersion === '') ||
|
if (($sPreviousVersion === '') ||
|
||||||
(version_compare($sPreviousVersion, $sCurrentVersion, '<')
|
(version_compare($sPreviousVersion, $sCurrentVersion, '<')
|
||||||
&& version_compare($sPreviousVersion, '3.0.1', '<'))) {
|
&& version_compare($sPreviousVersion, '3.0.0', '<'))) {
|
||||||
$oDataLoader = new XMLDataLoader();
|
$oDataLoader = new XMLDataLoader();
|
||||||
|
|
||||||
CMDBObject::SetTrackInfo("Initialization");
|
CMDBObject::SetTrackInfo("Initialization");
|
||||||
$oMyChange = CMDBObject::GetCurrentChange();
|
$oMyChange = CMDBObject::GetCurrentChange();
|
||||||
|
|
||||||
$sFileName = '';
|
$sLang = null;
|
||||||
$oFileConfig = new Config(APPCONF.'production/'.ITOP_CONFIG_FILE);
|
// - Try to get app. language from configuration fil (app. upgrade)
|
||||||
if (is_object($oFileConfig))
|
$sConfigFileName = APPCONF.'production/'.ITOP_CONFIG_FILE;
|
||||||
{
|
if (file_exists($sConfigFileName)) {
|
||||||
$sLang = str_replace(' ', '_', strtolower($oFileConfig->GetDefaultLanguage()));
|
$oFileConfig = new Config($sConfigFileName);
|
||||||
$sFileName = dirname(__FILE__)."/data/{$sLang}.data.itop-tickets.xml";
|
if (is_object($oFileConfig)) {
|
||||||
SetupLog::Info("Searching file: $sFileName");
|
$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)) {
|
if (!file_exists($sFileName)) {
|
||||||
$sFileName = dirname(__FILE__)."/data/en_us.data.itop-tickets.xml";
|
$sFileName = dirname(__FILE__)."/data/en_us.data.itop-tickets.xml";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user