From 4b46b2776acab6008d590fc1465f6fe6ac335207 Mon Sep 17 00:00:00 2001 From: Guillaume Lajarige Date: Wed, 27 Dec 2017 09:59:21 +0000 Subject: [PATCH] =?UTF-8?q?N=C2=B0916=20Fix=20impact=20analysis=20relation?= =?UTF-8?q?=20upstream=20description.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description was unique for both directions. Now 2 separate entries are used 'Realtion:/Stream+'. Translations for existing languages are already done. SVN:trunk[5166] --- core/metamodel.class.php | 30 +++++++++++++++++-- .../en.dict.itop-config-mgmt.php | 3 ++ .../es_cr.dict.itop-config-mgmt.php | 3 ++ .../fr.dict.itop-config-mgmt.php | 3 ++ .../hu.dict.itop-config-mgmt.php | 3 ++ .../it.dict.itop-config-mgmt.php | 3 ++ .../ja.dict.itop-config-mgmt.php | 3 ++ .../nl.dict.itop-config-mgmt.php | 3 ++ .../pt_br.dict.itop-config-mgmt.php | 3 ++ .../ru.dict.itop-config-mgmt.php | 3 ++ .../tr.dict.itop-config-mgmt.php | 3 ++ .../zh.dict.itop-config-mgmt.php | 3 ++ pages/UI.php | 7 +++-- 13 files changed, 65 insertions(+), 5 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 4744d21123..d829cd663b 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -1192,11 +1192,37 @@ abstract class MetaModel return $aClassRelations; } - final static public function GetRelationDescription($sRelCode) + /** + * @param string $sRelCode Relation code + * @param bool $bDown Relation direction, is it downstream (true) or upstream (false). Default is true. + * + * @return string + */ + final static public function GetRelationDescription($sRelCode, $bDown = true) { - return Dict::S("Relation:$sRelCode/Description"); + // Legacy convention had only one description describing the relation. + // Now, as the relation is bidirectional, we have a description for each directions. + $sLegacy = Dict::S("Relation:$sRelCode/Description"); + + if($bDown) + { + $sKey = "Relation:$sRelCode/DownStream+"; + } + else + { + $sKey = "Relation:$sRelCode/UpStream+"; + } + $sRet = Dict::S($sKey, $sLegacy); + + return $sRet; } + /** + * @param string $sRelCode Relation code + * @param bool $bDown Relation direction, is it downstream (true) or upstream (false). Default is true. + * + * @return string + */ final static public function GetRelationLabel($sRelCode, $bDown = true) { if ($bDown) diff --git a/datamodels/2.x/itop-config-mgmt/en.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/en.dict.itop-config-mgmt.php index d3ffc577a1..d94f8b2dd1 100755 --- a/datamodels/2.x/itop-config-mgmt/en.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/en.dict.itop-config-mgmt.php @@ -32,7 +32,10 @@ Dict::Add('EN US', 'English', 'English', array( 'Relation:impacts/Description' => 'Elements impacted by', 'Relation:impacts/DownStream' => 'Impacts...', + 'Relation:impacts/DownStream+' => 'Elements impacted by', 'Relation:impacts/UpStream' => 'Depends on......', + 'Relation:impacts/UpStream+' => 'Elements impacting', + // Legacy entries 'Relation:depends on/Description' => 'Elements impacting', 'Relation:depends on/DownStream' => 'Depends on...', 'Relation:depends on/UpStream' => 'Impacts...', diff --git a/datamodels/2.x/itop-config-mgmt/es_cr.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/es_cr.dict.itop-config-mgmt.php index 641705a778..7bcd8ad08e 100755 --- a/datamodels/2.x/itop-config-mgmt/es_cr.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/es_cr.dict.itop-config-mgmt.php @@ -33,7 +33,10 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array( 'Relation:impacts/Description' => 'Elementos Impactados por', 'Relation:impacts/DownStream' => 'Impacto...', + 'Relation:impacts/DownStream+' => 'Elementos Impactados por', 'Relation:impacts/UpStream' => 'Depende de...', + 'Relation:impacts/UpStream+' => 'Elementos de los cuales depende', + // Legacy entries 'Relation:depends on/Description' => 'Elementos de los cuales depende', 'Relation:depends on/DownStream' => 'Depende de...', 'Relation:depends on/UpStream' => 'Impactos...', diff --git a/datamodels/2.x/itop-config-mgmt/fr.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/fr.dict.itop-config-mgmt.php index a70f536d40..887eb07c51 100755 --- a/datamodels/2.x/itop-config-mgmt/fr.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/fr.dict.itop-config-mgmt.php @@ -1836,7 +1836,10 @@ Dict::Add('FR FR', 'French', 'Français', array( 'Menu:UI_WelcomeMenu_AllConfigItems' => 'Résumé', 'Relation:impacts/Description' => 'Eléments impactés par', 'Relation:impacts/DownStream' => 'Impacte...', + 'Relation:impacts/DownStream+' => 'Eléments impactés par', 'Relation:impacts/UpStream' => 'Dépend de...', + 'Relation:impacts/UpStream+' => 'Eléments dont dépend', + // Legacy entries 'Relation:depends on/Description' => 'Eléments dont dépend', 'Relation:depends on/DownStream' => 'Dépend de...', 'Relation:depends on/UpStream' => 'Impacte...', diff --git a/datamodels/2.x/itop-config-mgmt/hu.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/hu.dict.itop-config-mgmt.php index 2584ebf228..f36c075243 100755 --- a/datamodels/2.x/itop-config-mgmt/hu.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/hu.dict.itop-config-mgmt.php @@ -384,7 +384,10 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array( 'Class:lnkProcessToSolution/Attribute:reason+' => '', 'Relation:impacts/Description' => 'Konfigurációs elem működését befolyásolják', 'Relation:impacts/DownStream' => 'Hatás', + 'Relation:impacts/DownStream+' => 'Konfigurációs elem működését befolyásolják', 'Relation:impacts/UpStream' => 'Függőségek', + 'Relation:impacts/UpStream+' => 'Konfigurációs elemtől függnek', + // Legacy entries 'Relation:depends on/Description' => 'Konfigurációs elemtől függnek', 'Relation:depends on/DownStream' => 'Függőségek', 'Relation:depends on/UpStream' => 'Hatások', diff --git a/datamodels/2.x/itop-config-mgmt/it.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/it.dict.itop-config-mgmt.php index 07333109f1..4303837f4b 100755 --- a/datamodels/2.x/itop-config-mgmt/it.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/it.dict.itop-config-mgmt.php @@ -384,7 +384,10 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array( 'Class:lnkProcessToSolution/Attribute:reason+' => 'Più informazioni tra il processo di business e la soluzione applicativa', 'Relation:impacts/Description' => 'Elementi impattati da...', 'Relation:impacts/DownStream' => 'Impatto...', + 'Relation:impacts/DownStream+' => 'Elementi impattati da...', 'Relation:impacts/UpStream' => 'Dipende da...', + 'Relation:impacts/UpStream+' => 'Elementi di questo elemento dipende da', + // Legacy entries 'Relation:depends on/Description' => 'Elementi di questo elemento dipende da', 'Relation:depends on/DownStream' => 'Dipende da...', 'Relation:depends on/UpStream' => 'Impatto...', diff --git a/datamodels/2.x/itop-config-mgmt/ja.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/ja.dict.itop-config-mgmt.php index b6ef124f0c..c8a66212f5 100755 --- a/datamodels/2.x/itop-config-mgmt/ja.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/ja.dict.itop-config-mgmt.php @@ -596,7 +596,10 @@ Dict::Add('JA JP', 'Japanese', '日本語', array( 'Class:LogicalInterface/Attribute:virtualmachine_id+' => '', 'Relation:impacts/Description' => 'インパクトを受ける要素', 'Relation:impacts/DownStream' => 'インパクト...', + 'Relation:impacts/DownStream+' => 'インパクトを受ける要素', 'Relation:impacts/UpStream' => '依存...', + 'Relation:impacts/UpStream+' => 'この要素が依存している要素', + // Legacy entries 'Relation:depends on/Description' => 'この要素が依存している要素', 'Relation:depends on/DownStream' => '依存...', 'Relation:depends on/UpStream' => 'インパクト...', diff --git a/datamodels/2.x/itop-config-mgmt/nl.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/nl.dict.itop-config-mgmt.php index 687fdcde4f..b6faea5fb4 100644 --- a/datamodels/2.x/itop-config-mgmt/nl.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/nl.dict.itop-config-mgmt.php @@ -35,7 +35,10 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array( 'Relation:impacts/Description' => 'Elementen hebben impact op', 'Relation:impacts/DownStream' => 'Impact...', + 'Relation:impacts/DownStream+' => 'Elementen hebben impact op', 'Relation:impacts/UpStream' => 'Is afhankelijk van...', + 'Relation:impacts/UpStream+' => 'Elementen waarvan dit element afhankelijk van is', + // Legacy entries 'Relation:depends on/Description' => 'Elementen waarvan dit element afhankelijk van is', 'Relation:depends on/DownStream' => 'Is afhankelijk van...', 'Relation:depends on/UpStream' => 'Impacts...', diff --git a/datamodels/2.x/itop-config-mgmt/pt_br.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/pt_br.dict.itop-config-mgmt.php index 30c5661707..eb5f57951c 100755 --- a/datamodels/2.x/itop-config-mgmt/pt_br.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/pt_br.dict.itop-config-mgmt.php @@ -32,7 +32,10 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array( 'Relation:impacts/Description' => 'Elementos impactados por', 'Relation:impacts/DownStream' => 'Impacto...', + 'Relation:impacts/DownStream+' => 'Elementos impactados por', 'Relation:impacts/UpStream' => 'Depende de...', + 'Relation:impacts/UpStream+' => 'Elementos estes, que dependem deste elemento', + // Legacy entries 'Relation:depends on/Description' => 'Elementos estes, que dependem deste elemento', 'Relation:depends on/DownStream' => 'Depende de...', 'Relation:depends on/UpStream' => 'Impactos...', diff --git a/datamodels/2.x/itop-config-mgmt/ru.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/ru.dict.itop-config-mgmt.php index 0c9e9145af..dee1092d72 100755 --- a/datamodels/2.x/itop-config-mgmt/ru.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/ru.dict.itop-config-mgmt.php @@ -18,7 +18,10 @@ Dict::Add('RU RU', 'Russian', 'Русский', array( 'Relation:impacts/Description' => 'Элементы, на которые влияет', 'Relation:impacts/DownStream' => 'Влияет на...', + 'Relation:impacts/DownStream+' => 'Элементы, на которые влияет', 'Relation:impacts/UpStream' => 'Зависит от...', + 'Relation:impacts/UpStream+' => 'Элементы, от которых зависит', + // Legacy entries 'Relation:depends on/Description' => 'Элементы, от которых зависит', 'Relation:depends on/DownStream' => 'Зависит от...', 'Relation:depends on/UpStream' => 'Влияет на...', diff --git a/datamodels/2.x/itop-config-mgmt/tr.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/tr.dict.itop-config-mgmt.php index fdb1e08d21..c6105c64c3 100755 --- a/datamodels/2.x/itop-config-mgmt/tr.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/tr.dict.itop-config-mgmt.php @@ -33,7 +33,10 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array( 'Relation:impacts/Description' => 'Etkilenen kalemler', 'Relation:impacts/DownStream' => 'Etkiler...', + 'Relation:impacts/DownStream+' => 'Etkilenen kalemler', 'Relation:impacts/UpStream' => 'Bağımlı olanlar...', + 'Relation:impacts/UpStream+' => 'Bu kaleme bağımlı olan kalemler', + // Legacy entries 'Relation:depends on/Description' => 'Bu kaleme bağımlı olan kalemler', 'Relation:depends on/DownStream' => 'Bağımlı olanlar...', 'Relation:depends on/UpStream' => 'Etkiledikleri...', diff --git a/datamodels/2.x/itop-config-mgmt/zh.dict.itop-config-mgmt.php b/datamodels/2.x/itop-config-mgmt/zh.dict.itop-config-mgmt.php index dce13915cf..0585315f5a 100755 --- a/datamodels/2.x/itop-config-mgmt/zh.dict.itop-config-mgmt.php +++ b/datamodels/2.x/itop-config-mgmt/zh.dict.itop-config-mgmt.php @@ -33,7 +33,10 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array( 'Relation:impacts/Description' => '被影响的元素', 'Relation:impacts/DownStream' => '影响...', + 'Relation:impacts/DownStream+' => '被影响的元素', 'Relation:impacts/UpStream' => '依赖于...', + 'Relation:impacts/UpStream+' => '该元素依赖的元素...', + // Legacy entries 'Relation:depends on/Description' => '该元素依赖的元素...', 'Relation:depends on/DownStream' => '依赖于...', 'Relation:depends on/UpStream' => '影响...', diff --git a/pages/UI.php b/pages/UI.php index 1e5ea4a307..1c4092aaf1 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1604,15 +1604,16 @@ EOF $sDirection = utils::ReadParam('direction', 'down'); $iGroupingThreshold = utils::ReadParam('g', 5); + $bDirDown = ($sDirection === 'down'); $oObj = MetaModel::GetObject($sClass, $id); $iMaxRecursionDepth = MetaModel::GetConfig()->Get('relations_max_depth', 20); $aSourceObjects = array($oObj); - $oP->set_title(MetaModel::GetRelationDescription($sRelation).' '.$oObj->GetName()); + $oP->set_title(MetaModel::GetRelationDescription($sRelation, $bDirDown).' '.$oObj->GetName()); $sPageId = "ui-relation-graph-".$sClass.'::'.$id; - $sLabel = $oObj->GetName().' '.MetaModel::GetRelationLabel($sRelation); - $sDescription = MetaModel::GetRelationDescription($sRelation).' '.$oObj->GetName(); + $sLabel = $oObj->GetName().' '.MetaModel::GetRelationLabel($sRelation, $bDirDown); + $sDescription = MetaModel::GetRelationDescription($sRelation, $bDirDown).' '.$oObj->GetName(); $oP->SetBreadCrumbEntry($sPageId, $sLabel, $sDescription); if ($sRelation == 'depends on')