Browse Source

N.667 Metamodel introspection (schema.php) to display lifecycle labels and codes (though the code were already visible in a tooltip).

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4748 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 years ago
parent
commit
bfacd9925c
3 changed files with 7 additions and 6 deletions
  1. 1 1
      dictionaries/dictionary.itop.ui.php
  2. 1 1
      dictionaries/fr.dictionary.itop.ui.php
  3. 5 4
      pages/schema.php

+ 1 - 1
dictionaries/dictionary.itop.ui.php

@@ -710,7 +710,7 @@ Dict::Add('EN US', 'English', 'English', array(
 	'UI:Schema:Links:n-n' => 'Classes linked to %1$s (n:n links):',
 	'UI:Schema:Links:All' => 'Graph of all related classes',
 	'UI:Schema:NoLifeCyle' => 'There is no life cycle defined for this class.',
-	'UI:Schema:LifeCycleTransitions' => 'Transitions',
+	'UI:Schema:LifeCycleTransitions' => 'States and Transitions',
 	'UI:Schema:LifeCyleAttributeOptions' => 'Attribute options',
 	'UI:Schema:LifeCycleHiddenAttribute' => 'Hidden',
 	'UI:Schema:LifeCycleReadOnlyAttribute' => 'Read-only',

+ 1 - 1
dictionaries/fr.dictionary.itop.ui.php

@@ -601,7 +601,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
 	'UI:Schema:Links:n-n' => 'Classes liées à %1$s (liens n:n) :',
 	'UI:Schema:Links:All' => 'Graphe de toutes les classes liées',
 	'UI:Schema:NoLifeCyle' => 'Aucun cycle de vie n\'est défini pour cette classe.',
-	'UI:Schema:LifeCycleTransitions' => 'Transitions',
+	'UI:Schema:LifeCycleTransitions' => 'Etats et Transitions',
 	'UI:Schema:LifeCyleAttributeOptions' => 'Options des attributs',
 	'UI:Schema:LifeCycleHiddenAttribute' => 'Caché',
 	'UI:Schema:LifeCycleReadOnlyAttribute' => 'Lecture seule',

+ 5 - 4
pages/schema.php

@@ -1,5 +1,5 @@
 <?php
-// Copyright (C) 2010-2016 Combodo SARL
+// Copyright (C) 2010-2017 Combodo SARL
 //
 //   This file is part of iTop.
 //
@@ -20,7 +20,7 @@
 /**
  * Presentation of the data model
  *
- * @copyright   Copyright (C) 2010-2016 Combodo SARL
+ * @copyright   Copyright (C) 2010-2017 Combodo SARL
  * @license     http://opensource.org/licenses/AGPL-3.0
  */
 
@@ -208,7 +208,8 @@ function DisplayLifecycle($oPage, $sClass)
 			foreach(MetaModel::EnumTransitions($sClass, $sStateCode) as $sStimulusCode => $aTransitionDef)
 			{
 				$sStimulusLabel = $aStimuli[$sStimulusCode]->GetLabel();
-				$sTargetStateLabel = MetaModel::GetStateLabel($sClass, $aTransitionDef['target_state']);
+				$sTargetState = $aTransitionDef['target_state'];
+				$sTargetStateLabel = MetaModel::GetStateLabel($sClass, $sTargetState);
 				if (count($aTransitionDef['actions']) > 0)
 				{
 					$aActionsDesc = array();
@@ -234,7 +235,7 @@ function DisplayLifecycle($oPage, $sClass)
 				{
 					$sActions = "";
 				}
-				$oPage->add("<li><span title=\"code: $sStimulusCode\" style=\"color:red;font-weight=bold;\">$sStimulusLabel</span> =&gt; $sTargetStateLabel $sActions</li>\n");
+				$oPage->add("<li><span title=\"code: $sStimulusCode\" style=\"color:red;font-weight=bold;\">$sStimulusLabel</span> <span style=\"color:grey;\">($sStimulusCode)</span> =&gt; $sTargetStateLabel <span style=\"color:grey;\">($sTargetState)</span> $sActions</li>\n");
 			}
 			$oPage->add("</ul>\n");
 		}