diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php
index 43674138f..88bb1c955 100644
--- a/application/cmdbabstract.class.inc.php
+++ b/application/cmdbabstract.class.inc.php
@@ -119,11 +119,12 @@ abstract class cmdbAbstractObject extends CMDBObject
$oBlock->Display($oPage, -1);
$oPage->add("\n");
+ $oPage->add("GetIcon()."\" style=\"margin-top:-30px; margin-right:10px; float:right\">\n");
}
- function DisplayBareDetails(WebPage $oPage)
+ function DisplayBareProperties(WebPage $oPage)
{
- $oPage->add($this->GetBareDetails($oPage));
+ $oPage->add($this->GetBareProperties($oPage));
}
function DisplayBareRelations(WebPage $oPage)
@@ -133,7 +134,7 @@ abstract class cmdbAbstractObject extends CMDBObject
$oPage->SetCurrentTabContainer('Related Objects');
foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode=>$oAttDef)
{
- if ((get_class($oAttDef) == 'AttributeLinkedSetIndirect') || (get_class($oAttDef) == 'AttributeLinkedSet'))
+ if ($oAttDef->IsLinkset())
{
$oPage->SetCurrentTab($oAttDef->GetLabel());
$oPage->p($oAttDef->GetDescription());
@@ -142,7 +143,7 @@ abstract class cmdbAbstractObject extends CMDBObject
{
$sTargetClass = $oAttDef->GetLinkedClass();
$oFilter = new DBObjectSearch($sTargetClass);
- $oFilter->AddCondition($oAttDef->GetExtKeyToMe(), $this->GetKey()); // @@@ condition has same name as field ??
+ $oFilter->AddCondition($oAttDef->GetExtKeyToMe(), $this->GetKey());
$oBlock = new DisplayBlock($oFilter, 'list', false);
$oBlock->Display($oPage, 0);
@@ -178,19 +179,32 @@ abstract class cmdbAbstractObject extends CMDBObject
return $sDisplayName;
}
- function GetBareDetails(WebPage $oPage)
+ function GetBareProperties(WebPage $oPage)
{
$sHtml = '';
$oAppContext = new ApplicationContext();
$sStateAttCode = MetaModel::GetStateAttributeCode(get_class($this));
$aDetails = array();
$sClass = get_class($this);
- $aList = MetaModel::GetZListItems($sClass, 'details');
+ $aDetailsList = MetaModel::GetZListItems($sClass, 'details');
+ $aFullList = MetaModel::ListAttributeDefs($sClass);
+ $aList = $aDetailsList;
+ // Compute the list of properties to display, first the attributes in the 'details' list, then
+ // all the remaining attributes that are not external fields
+ foreach($aFullList as $sAttCode => $void)
+ {
+ $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
+ if (!in_array($sAttCode, $aDetailsList) && (!$oAttDef->IsExternalField()))
+ {
+ $aList[] = $sAttCode;
+ }
+ }
foreach($aList as $sAttCode)
{
$iFlags = $this->GetAttributeFlags($sAttCode);
- if ( ($iFlags & OPT_ATT_HIDDEN) == 0)
+ $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
+ if ( (!$oAttDef->IsLinkSet()) && (($iFlags & OPT_ATT_HIDDEN) == 0) )
{
// The field is visible in the current state of the object
if ($sStateAttCode == $sAttCode)
@@ -240,7 +254,7 @@ abstract class cmdbAbstractObject extends CMDBObject
// Object's details
// template not found display the object using the *old style*
$this->DisplayBareHeader($oPage);
- $this->DisplayBareDetails($oPage);
+ $this->DisplayBareProperties($oPage);
$this->DisplayBareRelations($oPage);
}
}
@@ -987,46 +1001,104 @@ abstract class cmdbAbstractObject extends CMDBObject
$aDetails = array();
$aFieldsMap = array();
$oPage->add("