diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 71a2b566d..b8a7dfebd 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -839,6 +839,7 @@ EOF { $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode); $sAttDefClass = get_class($oAttDef); + $sAttLabel = MetaModel::GetLabel($sClass, $sAttCode); if ($bEditMode) { @@ -941,6 +942,7 @@ EOF // - Attribute code and AttributeDef. class $val['attcode'] = $sAttCode; $val['atttype'] = $sAttDefClass; + $val['attlabel'] = $sAttLabel; // - How the field should be rendered $val['layout'] = (in_array($oAttDef->GetEditClass(), static::GetAttEditClassesToRenderAsLargeField())) ? 'large' : 'small'; diff --git a/application/webpage.class.inc.php b/application/webpage.class.inc.php index 4dc2784ab..d2c4b9fc5 100644 --- a/application/webpage.class.inc.php +++ b/application/webpage.class.inc.php @@ -510,9 +510,10 @@ class WebPage implements Page $sLayout = isset($aAttrib['layout']) ? $aAttrib['layout'] : 'small'; $sDataAttributeCode = isset($aAttrib['attcode']) ? 'data-attribute-code="'.$aAttrib['attcode'].'"' : ''; $sDataAttributeType = isset($aAttrib['atttype']) ? 'data-attribute-type="'.$aAttrib['atttype'].'"' : ''; + $sDataAttributeLabel = isset($aAttrib['attlabel']) ? 'data-attribute-label="'.utils::HtmlEntities($aAttrib['attlabel']).'"' : ''; $sDataValueRaw = isset($aAttrib['value_raw']) ? 'data-value-raw="'.$aAttrib['value_raw'].'"' : ''; - $sHtml .= "
\n"; + $sHtml .= "
\n"; $sHtml .= "
{$aAttrib['label']}
\n"; $sHtml .= "
\n"; diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index df3478c22..fabf1d13d 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1,6 +1,6 @@ AddMetadata('attribute-code', $this->GetCode()); $oFormField->AddMetadata('attribute-type', get_class($this)); - if($this::IsScalar()) + $oFormField->AddMetadata('attribute-label', $this->GetLabel()); + if ($this::IsScalar()) { $oFormField->AddMetadata('value-raw', $oObject->Get($this->GetCode())); }