Browse Source

Complete the commit [3291] that changes the structure returned by MetaModel::EnumTransitions. I have carefully reviewed every call to EnumTransitions... and found out only one single missing case in the data model view.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3373 a333f486-631f-4898-b8df-5754b55c2be0
romainq 10 years ago
parent
commit
af273f881e
1 changed files with 18 additions and 1 deletions
  1. 18 1
      pages/schema.php

+ 18 - 1
pages/schema.php

@@ -211,7 +211,24 @@ function DisplayLifecycle($oPage, $sClass)
 				$sTargetStateLabel = MetaModel::GetStateLabel($sClass, $aTransitionDef['target_state']);
 				if (count($aTransitionDef['actions']) > 0)
 				{
-					$sActions = " <em>(".implode(', ', $aTransitionDef['actions']).")</em>";
+					$aActionsDesc = array();
+					foreach ($aTransitionDef['actions'] as $actionHandler)
+					{
+						if (is_string($actionHandler))
+						{
+							$aActionsDesc[] = $actionHandler;
+						}
+						else
+						{
+							$aParamsDesc = array();
+							foreach ($actionHandler['params'] as $aParamData)
+							{
+								$aParamsDesc[] = $aParamData['type'].':'.$aParamData['value'];
+							}
+							$aActionsDesc[] = $actionHandler['verb'].'('.implode(', ', $aParamsDesc).')';
+						}
+					}
+					$sActions = " <em>(".implode(', ', $aActionsDesc).")</em>";
 				}
 				else
 				{