mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3203 - Datamodel: Add semantic for image & state attributes Part. II
This commit is contained in:
@@ -834,7 +834,7 @@ EOF
|
||||
if ((!$oAttDef->IsLinkSet()) && (($iFlags & OPT_ATT_HIDDEN) == 0) && !($oAttDef instanceof AttributeDashboard)) {
|
||||
$sInputId = $this->m_iFormId.'_'.$sAttCode;
|
||||
if ($oAttDef->IsWritable()) {
|
||||
if ($sStateAttCode == $sAttCode) {
|
||||
if (($sStateAttCode === $sAttCode) && (MetaModel::HasLifecycle($sClass))) {
|
||||
// State attribute is always read-only from the UI
|
||||
$sHTMLValue = $this->GetStateLabel();
|
||||
$val = array(
|
||||
@@ -4565,7 +4565,7 @@ HTML
|
||||
//echo "<p>current value for $sAttCode : $currValue</p>";
|
||||
$oDummyObj->Set($sAttCode, $currValue);
|
||||
$aComments[$sAttCode] = '';
|
||||
if ($sAttCode != MetaModel::GetStateAttributeCode($sClass))
|
||||
if ($sAttCode != MetaModel::GetStateAttributeCode($sClass) || !MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
$aComments[$sAttCode] .= '<input type="checkbox" checked id="enable_'.$iFormId.'_'.$sAttCode.'" onClick="ToggleField(this.checked, \''.$iFormId.'_'.$sAttCode.'\')"/>';
|
||||
}
|
||||
@@ -4625,7 +4625,7 @@ HTML
|
||||
$oDummyObj->Set($sAttCode, null);
|
||||
}
|
||||
$aComments[$sAttCode] = '';
|
||||
if ($sAttCode != MetaModel::GetStateAttributeCode($sClass))
|
||||
if ($sAttCode != MetaModel::GetStateAttributeCode($sClass) || !MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
$aComments[$sAttCode] .= '<input type="checkbox" id="enable_'.$iFormId.'_'.$sAttCode.'" onClick="ToggleField(this.checked, \''.$iFormId.'_'.$sAttCode.'\')"/>';
|
||||
}
|
||||
@@ -4636,11 +4636,11 @@ HTML
|
||||
}
|
||||
}
|
||||
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
if (($sStateAttCode != '') && ($oDummyObj->GetState() == ''))
|
||||
if (MetaModel::HasLifecycle($sClass) && ($oDummyObj->GetState() == ''))
|
||||
{
|
||||
// Hmmm, it's not gonna work like this ! Set a default value for the "state"
|
||||
// Maybe we should use the "state" that is the most common among the objects...
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$aMultiValues = $aValues[$sStateAttCode];
|
||||
uasort($aMultiValues, 'MyComparison');
|
||||
foreach($aMultiValues as $sCurrValue => $aVal)
|
||||
|
||||
@@ -1673,6 +1673,7 @@ abstract class DBObject implements iDisplay
|
||||
public function GetAttributeFlags($sAttCode, &$aReasons = array(), $sTargetState = '')
|
||||
{
|
||||
$iFlags = 0; // By default (if no life cycle) no flag at all
|
||||
$sClass = get_class($this);
|
||||
|
||||
$aReadOnlyAtts = $this->GetReadOnlyAttributes();
|
||||
if (($aReadOnlyAtts != null) && (in_array($sAttCode, $aReadOnlyAtts)))
|
||||
@@ -1680,16 +1681,16 @@ abstract class DBObject implements iDisplay
|
||||
return OPT_ATT_READONLY;
|
||||
}
|
||||
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
|
||||
if (!empty($sStateAttCode))
|
||||
if (MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
if ($sTargetState != '')
|
||||
{
|
||||
$iFlags = MetaModel::GetAttributeFlags(get_class($this), $sTargetState, $sAttCode);
|
||||
$iFlags = MetaModel::GetAttributeFlags($sClass, $sTargetState, $sAttCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
$iFlags = MetaModel::GetAttributeFlags(get_class($this), $this->Get($sStateAttCode), $sAttCode);
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$iFlags = MetaModel::GetAttributeFlags($sClass, $this->Get($sStateAttCode), $sAttCode);
|
||||
}
|
||||
}
|
||||
$aReasons = array();
|
||||
@@ -1742,10 +1743,10 @@ abstract class DBObject implements iDisplay
|
||||
public function GetTransitionFlags($sAttCode, $sStimulus, &$aReasons = array(), $sOriginState = '')
|
||||
{
|
||||
$iFlags = 0; // By default (if no lifecycle) no flag at all
|
||||
$sClass = get_class($this);
|
||||
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
|
||||
// If no state attribute, there is no lifecycle
|
||||
if (empty($sStateAttCode))
|
||||
if (!MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
return $iFlags;
|
||||
}
|
||||
@@ -1753,6 +1754,7 @@ abstract class DBObject implements iDisplay
|
||||
// Retrieving current state if necessary
|
||||
if ($sOriginState === '')
|
||||
{
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$sOriginState = $this->Get($sStateAttCode);
|
||||
}
|
||||
|
||||
@@ -1760,7 +1762,7 @@ abstract class DBObject implements iDisplay
|
||||
$iAttributeFlags = $this->GetAttributeFlags($sAttCode, $aReasons, $sOriginState);
|
||||
|
||||
// Retrieving transition flags
|
||||
$iTransitionFlags = MetaModel::GetTransitionFlags(get_class($this), $sOriginState, $sStimulus, $sAttCode);
|
||||
$iTransitionFlags = MetaModel::GetTransitionFlags($sClass, $sOriginState, $sStimulus, $sAttCode);
|
||||
|
||||
// Merging transition flags with attribute flags
|
||||
$iFlags = $iTransitionFlags | $iAttributeFlags;
|
||||
@@ -1811,10 +1813,12 @@ abstract class DBObject implements iDisplay
|
||||
public function GetInitialStateAttributeFlags($sAttCode, &$aReasons = array())
|
||||
{
|
||||
$iFlags = 0;
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
|
||||
if (!empty($sStateAttCode))
|
||||
$sClass = get_class($this);
|
||||
|
||||
if (MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
$iFlags = MetaModel::GetInitialStateAttributeFlags(get_class($this), $this->Get($sStateAttCode), $sAttCode);
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$iFlags = MetaModel::GetInitialStateAttributeFlags($sClass, $this->Get($sStateAttCode), $sAttCode);
|
||||
}
|
||||
return $iFlags; // No need to care about the synchro flags since we'll be creating a new object anyway
|
||||
}
|
||||
@@ -3631,11 +3635,12 @@ abstract class DBObject implements iDisplay
|
||||
*/
|
||||
public function EnumTransitions()
|
||||
{
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
|
||||
if (empty($sStateAttCode)) return array();
|
||||
$sClass = get_class($this);
|
||||
if (!MetaModel::HasLifecycle($sClass)) return array();
|
||||
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$sState = $this->Get($sStateAttCode);
|
||||
return MetaModel::EnumTransitions(get_class($this), $sState);
|
||||
return MetaModel::EnumTransitions($sClass, $sState);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3681,14 +3686,14 @@ abstract class DBObject implements iDisplay
|
||||
public function ApplyStimulus($sStimulusCode, $bDoNotWrite = false)
|
||||
{
|
||||
$sClass = get_class($this);
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
if (empty($sStateAttCode))
|
||||
if (!MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
throw new CoreException('No lifecycle for the class '.$sClass);
|
||||
}
|
||||
|
||||
MyHelpers::CheckKeyInArray('object lifecycle stimulus', $sStimulusCode, MetaModel::EnumStimuli($sClass));
|
||||
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$aStateTransitions = $this->EnumTransitions();
|
||||
if (!array_key_exists($sStimulusCode, $aStateTransitions))
|
||||
{
|
||||
@@ -5338,10 +5343,10 @@ abstract class DBObject implements iDisplay
|
||||
*/
|
||||
public static function MakeDefaultInstance($sClass)
|
||||
{
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$oObj = MetaModel::NewObject($sClass);
|
||||
if (!empty($sStateAttCode))
|
||||
if (MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$sTargetState = MetaModel::GetDefaultState($sClass);
|
||||
$oObj->Set($sStateAttCode, $sTargetState);
|
||||
}
|
||||
|
||||
@@ -853,8 +853,13 @@ abstract class MetaModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the $sClass has a state attribute defined
|
||||
* Return true if the $sClass has a state attribute defined.
|
||||
*
|
||||
* Note that having a state attribute does NOT mean having a lifecycle!
|
||||
* - A Person with active/inactive state won't have transitions and therefore no lifecycle
|
||||
* - A UserRequest will have transitions between its states and so a lifecycle
|
||||
*
|
||||
* @see self::HasLifecycle($sClass)
|
||||
* @param string $sClass Datamodel class to check
|
||||
*
|
||||
* @return bool
|
||||
@@ -2372,6 +2377,22 @@ abstract class MetaModel
|
||||
{
|
||||
return self::$m_aStates[$sClass];
|
||||
}
|
||||
elseif (self::HasStateAttributeCode($sClass))
|
||||
{
|
||||
$sStateAttCode = self::GetStateAttributeCode($sClass);
|
||||
$oAttDef = self::GetAttributeDef($sClass, $sStateAttCode);
|
||||
|
||||
$aStates = [];
|
||||
foreach($oAttDef->GetAllowedValues() as $sStateCode => $sStateLabel)
|
||||
{
|
||||
$aStates[$sStateCode] = [
|
||||
'attribute_inherit' => '',
|
||||
'attribute_list' => [],
|
||||
];
|
||||
}
|
||||
|
||||
return $aStates;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
@@ -2429,6 +2450,21 @@ abstract class MetaModel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if $sClass has a lifecycle, which means that it has a state attribute AND stimuli
|
||||
*
|
||||
* @param string $sClass
|
||||
*
|
||||
* @return bool
|
||||
* @throws \CoreException
|
||||
* @since 3.0.0
|
||||
* @see self::HasStateAttributeCode($sClass)
|
||||
*/
|
||||
public static function HasLifecycle(string $sClass)
|
||||
{
|
||||
return self::HasStateAttributeCode($sClass) && !empty(self::EnumStimuli($sClass));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sClass
|
||||
* @param string $sStateValue
|
||||
@@ -2517,17 +2553,13 @@ abstract class MetaModel
|
||||
public static function GetAttributeFlags($sClass, $sState, $sAttCode)
|
||||
{
|
||||
$iFlags = 0; // By default (if no life cycle) no flag at all
|
||||
$sStateAttCode = self::GetStateAttributeCode($sClass);
|
||||
if (!empty($sStateAttCode))
|
||||
{
|
||||
if (self::HasLifecycle($sClass)) {
|
||||
$aStates = MetaModel::EnumStates($sClass);
|
||||
if (!array_key_exists($sState, $aStates))
|
||||
{
|
||||
if (!array_key_exists($sState, $aStates)) {
|
||||
throw new CoreException("Invalid state '$sState' for class '$sClass', expecting a value in {".implode(', ', array_keys($aStates))."}");
|
||||
}
|
||||
$aCurrentState = $aStates[$sState];
|
||||
if ((array_key_exists('attribute_list', $aCurrentState)) && (array_key_exists($sAttCode, $aCurrentState['attribute_list'])))
|
||||
{
|
||||
if ((array_key_exists('attribute_list', $aCurrentState)) && (array_key_exists($sAttCode, $aCurrentState['attribute_list']))) {
|
||||
$iFlags = $aCurrentState['attribute_list'][$sAttCode];
|
||||
}
|
||||
}
|
||||
@@ -2547,18 +2579,14 @@ abstract class MetaModel
|
||||
public static function GetTransitionFlags($sClass, $sState, $sStimulus, $sAttCode)
|
||||
{
|
||||
$iFlags = 0; // By default (if no lifecycle) no flag at all
|
||||
$sStateAttCode = self::GetStateAttributeCode($sClass);
|
||||
if (!empty($sStateAttCode))
|
||||
{
|
||||
if (self::HasLifecycle($sClass)) {
|
||||
$aTransitions = MetaModel::EnumTransitions($sClass, $sState);
|
||||
if (!array_key_exists($sStimulus, $aTransitions))
|
||||
{
|
||||
if (!array_key_exists($sStimulus, $aTransitions)) {
|
||||
throw new CoreException("Invalid transition '$sStimulus' for class '$sClass', expecting a value in {".implode(', ', array_keys($aTransitions))."}");
|
||||
}
|
||||
|
||||
$aCurrentTransition = $aTransitions[$sStimulus];
|
||||
if ((array_key_exists('attribute_list', $aCurrentTransition)) && (array_key_exists($sAttCode, $aCurrentTransition['attribute_list'])))
|
||||
{
|
||||
if ((array_key_exists('attribute_list', $aCurrentTransition)) && (array_key_exists($sAttCode, $aCurrentTransition['attribute_list']))) {
|
||||
$iFlags = $aCurrentTransition['attribute_list'][$sAttCode];
|
||||
}
|
||||
}
|
||||
@@ -2637,37 +2665,30 @@ abstract class MetaModel
|
||||
public static function GetInitialStateAttributeFlags($sClass, $sState, $sAttCode)
|
||||
{
|
||||
$iFlags = self::GetAttributeFlags($sClass, $sState, $sAttCode); // Be default set the same flags as the 'target' state
|
||||
$sStateAttCode = self::GetStateAttributeCode($sClass);
|
||||
if (!empty($sStateAttCode))
|
||||
{
|
||||
if (self::HasLifecycle($sClass)) {
|
||||
$aStates = MetaModel::EnumInitialStates($sClass);
|
||||
if (array_key_exists($sState, $aStates))
|
||||
{
|
||||
if (array_key_exists($sState, $aStates)) {
|
||||
$bReadOnly = (($iFlags & OPT_ATT_READONLY) == OPT_ATT_READONLY);
|
||||
$bHidden = (($iFlags & OPT_ATT_HIDDEN) == OPT_ATT_HIDDEN);
|
||||
foreach($aStates[$sState] as $sPrevState)
|
||||
{
|
||||
foreach($aStates[$sState] as $sPrevState) {
|
||||
$iPrevFlags = self::GetAttributeFlags($sClass, $sPrevState, $sAttCode);
|
||||
if (($iPrevFlags & OPT_ATT_HIDDEN) != OPT_ATT_HIDDEN)
|
||||
{
|
||||
if (($iPrevFlags & OPT_ATT_HIDDEN) != OPT_ATT_HIDDEN) {
|
||||
$bReadOnly = $bReadOnly && (($iPrevFlags & OPT_ATT_READONLY) == OPT_ATT_READONLY); // if it is/was not readonly => then it's not
|
||||
}
|
||||
$bHidden = $bHidden && (($iPrevFlags & OPT_ATT_HIDDEN) == OPT_ATT_HIDDEN); // if it is/was not hidden => then it's not
|
||||
}
|
||||
if ($bReadOnly)
|
||||
{
|
||||
|
||||
if ($bReadOnly) {
|
||||
$iFlags = $iFlags | OPT_ATT_READONLY;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$iFlags = $iFlags & ~OPT_ATT_READONLY;
|
||||
}
|
||||
if ($bHidden)
|
||||
{
|
||||
|
||||
if ($bHidden) {
|
||||
$iFlags = $iFlags | OPT_ATT_HIDDEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$iFlags = $iFlags & ~OPT_ATT_HIDDEN;
|
||||
}
|
||||
}
|
||||
@@ -2877,6 +2898,25 @@ abstract class MetaModel
|
||||
}
|
||||
self::$m_aClassParams[$sPHPClass]['obsolescence_expression'] = $sObsolescence;
|
||||
|
||||
// Inherit fields semantic
|
||||
// - State attribute
|
||||
$bParentHasStateAttribute = (isset(self::$m_aClassParams[$sParent]['state_attcode']) && !empty(self::$m_aClassParams[$sParent]['state_attcode']));
|
||||
$bHasStateAttribute = (isset(self::$m_aClassParams[$sPHPClass]['state_attcode']) && !empty(self::$m_aClassParams[$sPHPClass]['state_attcode']));
|
||||
if($bParentHasStateAttribute && !$bHasStateAttribute) {
|
||||
// Set attribute code
|
||||
self::$m_aClassParams[$sPHPClass]['state_attcode'] = self::$m_aClassParams[$sParent]['state_attcode'];
|
||||
|
||||
// Set states
|
||||
self::$m_aStates[$sPHPClass] = self::$m_aStates[$sParent];
|
||||
}
|
||||
// - Image attribute
|
||||
$bParentHasImageAttribute = (isset(self::$m_aClassParams[$sParent]['image_attcode']) && !empty(self::$m_aClassParams[$sParent]['image_attcode']));
|
||||
$bHasImageAttribute = (isset(self::$m_aClassParams[$sPHPClass]['image_attcode']) && !empty(self::$m_aClassParams[$sPHPClass]['image_attcode']));
|
||||
if($bParentHasImageAttribute && !$bHasImageAttribute) {
|
||||
// Set attribute code
|
||||
self::$m_aClassParams[$sPHPClass]['image_attcode'] = self::$m_aClassParams[$sParent]['image_attcode'];
|
||||
}
|
||||
|
||||
foreach(MetaModel::EnumPlugins('iOnClassInitialization') as $sPluginClass => $oClassInit)
|
||||
{
|
||||
$oClassInit->OnAfterClassInitialization($sPHPClass);
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/change.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -199,7 +202,6 @@
|
||||
</field>
|
||||
</fields>
|
||||
<lifecycle>
|
||||
<attribute>status</attribute>
|
||||
<highlight_scale>
|
||||
<item id="approved">
|
||||
<rank>1</rank>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/change.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -160,7 +163,6 @@
|
||||
<icon>images/change-closed.png</icon>
|
||||
</item>
|
||||
</highlight_scale>
|
||||
<attribute>status</attribute>
|
||||
<stimuli>
|
||||
<stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
|
||||
<stimulus id="ev_plan" xsi:type="StimulusUserAction"/>
|
||||
|
||||
@@ -256,6 +256,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/server.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1516,6 +1519,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/solution.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1657,6 +1663,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/business-process.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1768,6 +1777,9 @@
|
||||
<attribute id="system_name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/application.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -5972,6 +5984,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/group.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/incident.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -376,7 +379,6 @@
|
||||
<icon>images/incident-closed.png</icon>
|
||||
</item>
|
||||
</highlight_scale>
|
||||
<attribute>status</attribute>
|
||||
<stimuli>
|
||||
<stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
|
||||
<stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/problem.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -160,7 +163,6 @@
|
||||
</field>
|
||||
</fields>
|
||||
<lifecycle>
|
||||
<attribute>status</attribute>
|
||||
<stimuli>
|
||||
<stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
|
||||
<stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/user-request.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -408,7 +411,6 @@
|
||||
<icon>images/user-request-closed.png</icon>
|
||||
</item>
|
||||
</highlight_scale>
|
||||
<attribute>status</attribute>
|
||||
<stimuli>
|
||||
<stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
|
||||
<stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/user-request.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -412,7 +415,6 @@
|
||||
<icon>images/user-request-closed.png</icon>
|
||||
</item>
|
||||
</highlight_scale>
|
||||
<attribute>status</attribute>
|
||||
<stimuli>
|
||||
<stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
|
||||
<stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/contract.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -984,9 +987,9 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<semantic>
|
||||
<fields_semantic>
|
||||
<image_attribute>icon</image_attribute>
|
||||
</semantic>
|
||||
</fields_semantic>
|
||||
<icon>images/service.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1069,9 +1072,10 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<semantic>
|
||||
<fields_semantic>
|
||||
<image_attribute>icon</image_attribute>
|
||||
</semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/service.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1421,6 +1425,9 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/service.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/contract.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -876,9 +879,9 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<semantic>
|
||||
<fields_semantic>
|
||||
<image_attribute>icon</image_attribute>
|
||||
</semantic>
|
||||
</fields_semantic>
|
||||
<icon>images/service.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -961,9 +964,10 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<semantic>
|
||||
<fields_semantic>
|
||||
<image_attribute>icon</image_attribute>
|
||||
</semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/service.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1335,6 +1339,9 @@ public function PrefillSearchForm(&$aContextParam)
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/service.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/building.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -181,6 +184,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/location.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -347,6 +353,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/team.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -514,9 +523,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<semantic>
|
||||
<fields_semantic>
|
||||
<image_attribute>picture</image_attribute>
|
||||
</semantic>
|
||||
</fields_semantic>
|
||||
<icon>images/person.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -1099,6 +1108,9 @@
|
||||
<naming>
|
||||
<attributes/>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/document.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
|
||||
@@ -475,6 +475,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon>images/workorder.png</icon>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
@@ -557,7 +560,6 @@
|
||||
</field>
|
||||
</fields>
|
||||
<lifecycle>
|
||||
<attribute>status</attribute>
|
||||
<stimuli>
|
||||
<stimulus id="ev_close" xsi:type="StimulusUserAction"/>
|
||||
</stimuli>
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<attribute id="name"/>
|
||||
</attributes>
|
||||
</naming>
|
||||
<fields_semantic>
|
||||
<state_attribute>status</state_attribute>
|
||||
</fields_semantic>
|
||||
<icon/>
|
||||
<reconciliation>
|
||||
<attributes>
|
||||
|
||||
@@ -1225,9 +1225,9 @@ HTML
|
||||
{
|
||||
/** @var \cmdbAbstractObject $oObj */
|
||||
$oObj = MetaModel::NewObject($sClass);
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
if (!empty($sStateAttCode))
|
||||
if (MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
$sTargetState = utils::ReadPostedParam('obj_state', '');
|
||||
if ($sTargetState != '')
|
||||
{
|
||||
|
||||
@@ -45,8 +45,7 @@ function GraphvizEscape($s)
|
||||
function GraphvizLifecycle($sClass)
|
||||
{
|
||||
$sDotFileContent = "";
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
if (empty($sStateAttCode))
|
||||
if (!MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
//$oPage->p("no lifecycle for this class");
|
||||
}
|
||||
|
||||
@@ -84,8 +84,7 @@ function DisplaySubclasses($oPage, $sClass, $sContext)
|
||||
*/
|
||||
function DisplayLifecycle($oPage, $sClass)
|
||||
{
|
||||
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
if (empty($sStateAttCode))
|
||||
if (!MetaModel::HasLifecycle($sClass))
|
||||
{
|
||||
$oPage->p(Dict::S('UI:Schema:NoLifeCyle'));
|
||||
}
|
||||
|
||||
@@ -1029,31 +1029,24 @@ EOF
|
||||
// - Default attributes code
|
||||
$sImageAttCode = "";
|
||||
$sStateAttCode = "";
|
||||
// - Parse optional semantic node
|
||||
$oSemantic = $oProperties->GetOptionalElement('semantic');
|
||||
if ($oSemantic) {
|
||||
// - Parse optional fields semantic node
|
||||
$oFieldsSemantic = $oProperties->GetOptionalElement('fields_semantic');
|
||||
if ($oFieldsSemantic) {
|
||||
// Image attribute
|
||||
$oImageAttribute = $oSemantic->GetOptionalElement('image_attribute');
|
||||
$oImageAttribute = $oFieldsSemantic->GetOptionalElement('image_attribute');
|
||||
if ($oImageAttribute) {
|
||||
$sImageAttCode = $oImageAttribute->GetText();
|
||||
}
|
||||
|
||||
// State attribute, only if not already found from lifecycle
|
||||
// $oStateAttribute = $oSemantic->GetOptionalElement('state_attribute');
|
||||
// if(empty($sStateAttCode) && $oStateAttribute) {
|
||||
// $sStateAttCode = $oStateAttribute->GetText();
|
||||
// }
|
||||
// State attribute (for XML v1.7- the lifecycle/attribute node should have been migrated in this one)
|
||||
$oStateAttribute = $oFieldsSemantic->GetOptionalElement('state_attribute');
|
||||
if($oStateAttribute) {
|
||||
$sStateAttCode = $oStateAttribute->GetText();
|
||||
}
|
||||
}
|
||||
$aClassParams['image_attcode'] = "'$sImageAttCode'";
|
||||
$aClassParams['state_attcode'] = "'$sStateAttCode'";
|
||||
|
||||
// Lifecycle (overload any state attribute defined in the semantic node)
|
||||
$oLifecycle = $oClass->GetOptionalElement('lifecycle');
|
||||
if ($oLifecycle) {
|
||||
$sStateAttCode = $oLifecycle->GetChildText('attribute');
|
||||
$aClassParams['state_attcode'] = "'$sStateAttCode'";
|
||||
}
|
||||
|
||||
// Reconcialiation
|
||||
if ($oReconciliation = $oProperties->GetOptionalElement('reconciliation'))
|
||||
{
|
||||
@@ -1641,8 +1634,8 @@ EOF
|
||||
//
|
||||
$sLifecycle = '';
|
||||
$sHighlightScale = '';
|
||||
if ($oLifecycle)
|
||||
{
|
||||
$oLifecycle = $oClass->GetOptionalElement('lifecycle');
|
||||
if ($oLifecycle) {
|
||||
$sLifecycle .= "\t\t// Lifecycle (status attribute: $sStateAttCode)\n";
|
||||
$sLifecycle .= "\t\t//\n";
|
||||
|
||||
@@ -1869,6 +1862,26 @@ EOF
|
||||
}
|
||||
}
|
||||
}
|
||||
// No "real" lifecycle with stimuli and such but still a state attribute, we need to define states from the enum. values
|
||||
elseif ($oFieldsSemantic && $oStateAttribute) {
|
||||
$sLifecycle .= "\t\t// States but no lifecycle declared in XML (status attribute: $sStateAttCode)\n";
|
||||
$sLifecycle .= "\t\t//\n";
|
||||
|
||||
// Note: We can't use ModelFactory::GetField() as the current clas doesn't seem to be loaded yet.
|
||||
$oField = $this->oFactory->GetNodes('field[@id="'.$sStateAttCode.'"]', $oFields)->item(0);
|
||||
$oValues = $oField->GetUniqueElement('values');
|
||||
$oValueNodes = $oValues->getElementsByTagName('value');
|
||||
foreach($oValueNodes as $oValue)
|
||||
{
|
||||
$sLifecycle .= " MetaModel::Init_DefineState(\n";
|
||||
$sLifecycle .= " \"".$oValue->GetText()."\",\n";
|
||||
$sLifecycle .= " array(\n";
|
||||
$sLifecycle .= " \"attribute_inherit\" => '',\n";
|
||||
$sLifecycle .= " \"attribute_list\" => array()\n";
|
||||
$sLifecycle .= " )\n";
|
||||
$sLifecycle .= " );\n";
|
||||
}
|
||||
}
|
||||
|
||||
// ZLists
|
||||
//
|
||||
|
||||
@@ -95,7 +95,7 @@ class iTopDesignFormat
|
||||
'go_to_previous' => 'From18To17',
|
||||
'next' => null,
|
||||
'go_to_next' => null,
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -768,9 +768,35 @@ class iTopDesignFormat
|
||||
*/
|
||||
protected function From17To18($oFactory)
|
||||
{
|
||||
$oXPath = new DOMXPath($this->oDocument);
|
||||
|
||||
// N°3233 - Remove "display template" feature from MetaModel
|
||||
$sPath = "/itop_design//class/properties/display_template";
|
||||
$this->RemoveNodeFromXPath($sPath);
|
||||
|
||||
// N°3203 - Datamodel: Add semantic for image & state attributes
|
||||
// - Move lifecycle attribute declaration to the semantic node
|
||||
$oNodeList = $oXPath->query("/itop_design//class/lifecycle/attribute");
|
||||
/** @var \DOMElement $oNode */
|
||||
foreach ($oNodeList as $oNode) {
|
||||
// Find semantic node or create it
|
||||
$oPropertiesNode = $oXPath->query("../../properties", $oNode)->item(0);
|
||||
$oFieldsSemanticNodeList = $oXPath->query("fields_semantic", $oPropertiesNode);
|
||||
if ($oFieldsSemanticNodeList->length > 0) {
|
||||
$oSemanticNode = $oFieldsSemanticNodeList->item(0);
|
||||
}
|
||||
else {
|
||||
$oSemanticNode = $oPropertiesNode->ownerDocument->createElement("fields_semantic");
|
||||
$oPropertiesNode->appendChild($oSemanticNode);
|
||||
}
|
||||
|
||||
// Create state_attribute node
|
||||
$oStateNode = $oSemanticNode->ownerDocument->createElement("state_attribute", $oNode->nodeValue);
|
||||
$oSemanticNode->appendChild($oStateNode);
|
||||
|
||||
// Remove current node from lifecycle
|
||||
$this->DeleteNode($oNode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -780,6 +806,8 @@ class iTopDesignFormat
|
||||
*/
|
||||
protected function From18To17($oFactory)
|
||||
{
|
||||
$oXPath = new DOMXPath($this->oDocument);
|
||||
|
||||
// N°3182 - Remove style node from MenuGroup
|
||||
$sPath = "/itop_design/menus/menu[@xsi:type='MenuGroup']/style";
|
||||
$this->RemoveNodeFromXPath($sPath);
|
||||
@@ -791,6 +819,27 @@ class iTopDesignFormat
|
||||
// N°2982 - Speed up SCSS themes compilation during setup
|
||||
$sPath = "/itop_design/branding/themes/theme/precompiled_stylesheet";
|
||||
$this->RemoveNodeFromXPath($sPath);
|
||||
|
||||
// N°3203 - Datamodel: Add semantic for image & state attributes
|
||||
// - Move state_attribute back to the lifecycle node if it has one
|
||||
$oNodeList = $oXPath->query("/itop_design//class/properties/fields_semantic/state_attribute");
|
||||
/** @var \DOMElement $oNode */
|
||||
foreach ($oNodeList as $oNode) {
|
||||
// Move node under lifecycle only if there is such a node
|
||||
$oLifecycleNode = $oXPath->query("../../../lifecycle", $oNode)->item(0);
|
||||
if($oLifecycleNode !== null)
|
||||
{
|
||||
// Create attribute node
|
||||
$oAttributeNode = $oLifecycleNode->ownerDocument->createElement("attribute", $oNode->nodeValue);
|
||||
$oLifecycleNode->appendChild($oAttributeNode);
|
||||
}
|
||||
|
||||
// Remove current node from semantic in all cases
|
||||
$this->DeleteNode($oNode);
|
||||
}
|
||||
// - Remove semantic node
|
||||
$sPath = "/itop_design//class/properties/fields_semantic";
|
||||
$this->RemoveNodeFromXPath($sPath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,8 +52,8 @@ class TitleFactory
|
||||
$oTitle->SetIcon($sObjIconUrl, $sIconCoverMethod);
|
||||
}
|
||||
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($sObjClass);
|
||||
if (!empty($sStatusAttCode)) {
|
||||
if (MetaModel::HasStateAttributeCode($sObjClass)) {
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($sObjClass);
|
||||
$sStateCode = $oObject->GetState();
|
||||
$sStatusLabel = $oObject->GetStateLabel();
|
||||
$sStatusColor = UIHelper::GetColorFromStatus(get_class($oObject), $sStateCode);
|
||||
|
||||
@@ -45,7 +45,7 @@ class CMDBChangeOpSetAttributeScalarFactory extends CMDBChangeOpSetAttributeFact
|
||||
$sAttCode = $oChangeOp->Get('attcode');
|
||||
|
||||
// Specific ActivityEntry for transition, otherwise just a regular EditsEntry
|
||||
if($sAttCode === MetaModel::GetStateAttributeCode($sHostObjectClass))
|
||||
if(MetaModel::HasLifecycle($sHostObjectClass) && ($sAttCode === MetaModel::GetStateAttributeCode($sHostObjectClass)))
|
||||
{
|
||||
$oDateTime = DateTime::createFromFormat(AttributeDateTime::GetInternalFormat(), $oChangeOp->Get('date'));
|
||||
|
||||
|
||||
@@ -48,8 +48,7 @@ class ObjectDetails extends Panel
|
||||
$this->sName = $oObject->GetRawName();
|
||||
$this->sIconUrl = $oObject->GetIcon(false);
|
||||
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($this->sClassName);
|
||||
if(!empty($sStatusAttCode)) {
|
||||
if(MetaModel::HasStateAttributeCode($this->sClassName)) {
|
||||
$this->sStatusCode = $oObject->GetState();
|
||||
$this->sStatusLabel = $oObject->GetStateLabel();
|
||||
$this->sStatusColor = UIHelper::GetColorFromStatus($this->sClassName, $this->sStatusCode);
|
||||
|
||||
14
test/setup/iTopDesignFormat/1.7_to_1.8.expected.xml
Normal file
14
test/setup/iTopDesignFormat/1.7_to_1.8.expected.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.8">
|
||||
<classes>
|
||||
<class id="ClassWithLifecycle">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
<fields_semantic>
|
||||
<state_attribute>foo</state_attribute>
|
||||
</fields_semantic>
|
||||
</properties>
|
||||
<lifecycle/>
|
||||
</class>
|
||||
</classes>
|
||||
</itop_design>
|
||||
13
test/setup/iTopDesignFormat/1.7_to_1.8.input.xml
Normal file
13
test/setup/iTopDesignFormat/1.7_to_1.8.input.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
|
||||
<classes>
|
||||
<class id="ClassWithLifecycle">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
</properties>
|
||||
<lifecycle>
|
||||
<attribute>foo</attribute>
|
||||
</lifecycle>
|
||||
</class>
|
||||
</classes>
|
||||
</itop_design>
|
||||
@@ -1,5 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
|
||||
<classes>
|
||||
<class id="ClassWithStateButNoLifecycle">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
</properties>
|
||||
</class>
|
||||
<class id="ClassWithStateAndLifecycle">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
</properties>
|
||||
<lifecycle>
|
||||
<attribute>foo</attribute>
|
||||
</lifecycle>
|
||||
</class>
|
||||
<class id="ClassWithStateAndImage">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
</properties>
|
||||
</class>
|
||||
<class id="ClassWithImageOnly">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
</properties>
|
||||
</class>
|
||||
</classes>
|
||||
<menus>
|
||||
<menu id="WelcomeMenuLink1" xsi:type="WebPageMenuNode" _delta="define">
|
||||
<rank>100</rank>
|
||||
|
||||
@@ -1,22 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.8">
|
||||
<menus>
|
||||
<menu id="WelcomeMenuLink1" xsi:type="WebPageMenuNode" _delta="define">
|
||||
<rank>100</rank>
|
||||
<parent>WelcomeMenu</parent>
|
||||
<url>$$http://fr.wikipedia.org/</url>
|
||||
<in_new_window>true</in_new_window>
|
||||
</menu>
|
||||
<menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
|
||||
<rank>30</rank>
|
||||
<enable_stimulus/>
|
||||
<style>
|
||||
<decoration_classes>fas fa-comment-alt</decoration_classes>
|
||||
</style>
|
||||
</menu>
|
||||
</menus>
|
||||
<branding>
|
||||
<main_logo _delta="define">images/itop-logo.png</main_logo>
|
||||
<main_logo_compact _delta="define">images/itop-logo-square.png</main_logo_compact>
|
||||
</branding>
|
||||
<classes>
|
||||
<class id="ClassWithStateButNoLifecycle">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
<fields_semantic>
|
||||
<state_attribute>foo</state_attribute>
|
||||
</fields_semantic>
|
||||
</properties>
|
||||
</class>
|
||||
<class id="ClassWithStateAndLifecycle">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
<fields_semantic>
|
||||
<state_attribute>foo</state_attribute>
|
||||
</fields_semantic>
|
||||
</properties>
|
||||
<lifecycle/>
|
||||
</class>
|
||||
<class id="ClassWithStateAndImage">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
<fields_semantic>
|
||||
<state_attribute>foo</state_attribute>
|
||||
<image_attribute>bar</image_attribute>
|
||||
</fields_semantic>
|
||||
</properties>
|
||||
</class>
|
||||
<class id="ClassWithImageOnly">
|
||||
<properties>
|
||||
<icon>images/class-with-lifecycle.png</icon>
|
||||
<fields_semantic>
|
||||
<image_attribute>bar</image_attribute>
|
||||
</fields_semantic>
|
||||
</properties>
|
||||
</class>
|
||||
</classes>
|
||||
<menus>
|
||||
<menu id="WelcomeMenuLink1" xsi:type="WebPageMenuNode" _delta="define">
|
||||
<rank>100</rank>
|
||||
<parent>WelcomeMenu</parent>
|
||||
<url>$$http://fr.wikipedia.org/</url>
|
||||
<in_new_window>true</in_new_window>
|
||||
</menu>
|
||||
<menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
|
||||
<rank>30</rank>
|
||||
<enable_stimulus/>
|
||||
<style>
|
||||
<decoration_classes>fas fa-comment-alt</decoration_classes>
|
||||
</style>
|
||||
</menu>
|
||||
</menus>
|
||||
<branding>
|
||||
<main_logo _delta="define">images/itop-logo.png</main_logo>
|
||||
<main_logo_compact _delta="define">images/itop-logo-square.png</main_logo_compact>
|
||||
</branding>
|
||||
</itop_design>
|
||||
|
||||
@@ -68,6 +68,7 @@ class TestForITopDesignFormatClass extends ItopTestCase
|
||||
{
|
||||
return array(
|
||||
'1.7 to 1.6' => array('1.6', '1.7_to_1.6.input', '1.7_to_1.6.expected'),
|
||||
'1.7 to 1.8' => array('1.8', '1.7_to_1.8.input', '1.7_to_1.8.expected'),
|
||||
'1.8 to 1.7' => array('1.7', '1.8_to_1.7.input', '1.8_to_1.7.expected'),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user