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

SVN:trunk[4748]
This commit is contained in:
Romain Quetiez
2017-05-22 15:35:16 +00:00
parent c2c0221535
commit 2118a5da71
3 changed files with 7 additions and 6 deletions

View File

@@ -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',

View File

@@ -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',

View File

@@ -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");
}