mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
#944 Better initialization of the 'origin' field based on localized comments.
SVN:trunk[3238]
This commit is contained in:
@@ -607,9 +607,20 @@ class ApplicationInstaller
|
||||
$sInit = "UPDATE `{$sDBPrefix}priv_change` SET `origin` = 'csv-interactive' WHERE `userinfo` LIKE '%(CSV)' AND origin = 'interactive'";
|
||||
CMDBSource::Query($sInit);
|
||||
|
||||
// Syncho data sources were identified by the comment at the end (Yes: Synchronisation with a S!!)
|
||||
$sInit = "UPDATE `{$sDBPrefix}priv_change` SET `origin` = 'synchro-data-source' WHERE `userinfo` LIKE '%(Synchronisation)'";
|
||||
|
||||
// Syncho data sources were identified by the comment at the end
|
||||
// Unfortunately the comment is localized, so we have to search for all possible patterns
|
||||
$sCurrentLanguage = Dict::GetUserLanguage();
|
||||
foreach(Dict::GetLanguages() as $sLangCode => $aLang)
|
||||
{
|
||||
Dict::SetUserLanguage($sLangCode);
|
||||
$sSuffix = CMDBSource::Quote('%'.Dict::S('Core:SyncDataExchangeComment'));
|
||||
$aSuffixes[$sSuffix] = true;
|
||||
}
|
||||
Dict::SetUserLanguage($sCurrentLanguage);
|
||||
$sCondition = "`userinfo` LIKE ".implode(" OR `userinfo` LIKE ", array_keys($aSuffixes));
|
||||
|
||||
$sInit = "UPDATE `{$sDBPrefix}priv_change` SET `origin` = 'synchro-data-source' WHERE ($sCondition)";
|
||||
CMDBSource::Query($sInit);
|
||||
|
||||
SetupPage::log_info("Initialization of '{$sDBPrefix}priv_change.origin' completed.");
|
||||
|
||||
Reference in New Issue
Block a user