diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 7602639b0..e4ba02414 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -4206,6 +4206,7 @@ EOF { $oPage->SetCurrentTab('UI:PropertiesTab'); $sClass = get_class($this); + if ($this->IsNew()) { $iFlags = $this->GetInitialStateAttributeFlags($sAttCode); @@ -4214,6 +4215,7 @@ EOF { $iFlags = $this->GetAttributeFlags($sAttCode); } + if ($iFlags & OPT_ATT_HIDDEN) { // The case log is hidden do nothing @@ -4221,6 +4223,16 @@ EOF else { $oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode); + $sAttDefClass = get_class($oAttDef); + $sAttLabel = $oAttDef->GetLabel(); + $sAttMetaDataLabel = utils::HtmlEntities($sAttLabel); + $sAttMetaDataFlagHidden = (($iFlags & OPT_ATT_HIDDEN) === OPT_ATT_HIDDEN) ? 'true' : 'false'; + $sAttMetaDataFlagReadOnly = (($iFlags & OPT_ATT_READONLY) === OPT_ATT_READONLY) ? 'true' : 'false'; + $sAttMetaDataFlagMandatory = (($iFlags & OPT_ATT_MANDATORY) === OPT_ATT_MANDATORY) ? 'true' : 'false'; + $sAttMetaDataFlagMustChange = (($iFlags & OPT_ATT_MUSTCHANGE) === OPT_ATT_MUSTCHANGE) ? 'true' : 'false'; + $sAttMetaDataFlagMustPrompt = (($iFlags & OPT_ATT_MUSTPROMPT) === OPT_ATT_MUSTPROMPT) ? 'true' : 'false'; + $sAttMetaDataFlagSlave = (($iFlags & OPT_ATT_SLAVE) === OPT_ATT_SLAVE) ? 'true' : 'false'; + $sInputId = $this->m_iFormId.'_'.$sAttCode; if ((!$bEditMode) || ($iFlags & (OPT_ATT_READONLY | OPT_ATT_SLAVE))) @@ -4257,19 +4269,32 @@ EOF $sValue = $this->Get($sAttCode); $sDisplayValue = $this->GetEditValue($sAttCode); $aArgs = array('this' => $this, 'formPrefix' => $sPrefix); - $sHTMLValue = ''; - if ($sComment != '') - { - $sHTMLValue = ''.$sComment.'
'; - } - $sHTMLValue .= "".self::GetFormElementForField($oPage, - $sClass, $sAttCode, $oAttDef, $sValue, $sDisplayValue, $sInputId, '', $iFlags, - $aArgs).''; + + $sCommentAsHtml = ($sComment != '') ? ''.$sComment.'
' : ''; + $sFieldAsHtml = self::GetFormElementForField($oPage, $sClass, $sAttCode, $oAttDef, $sValue, $sDisplayValue, $sInputId, '', $iFlags, $aArgs); + $sHTMLValue = << +
+ $sCommentAsHtml + $sFieldAsHtml +
+ +HTML; + $aFieldsMap[$sAttCode] = $sInputId; } - $oPage->add('
'.$oAttDef->GetLabel().''); - $oPage->add($sHTMLValue); - $oPage->add('
'); + + $oPage->add(<< + {$sAttLabel} +
+ {$sHTMLValue} +
+ +HTML + ); } }