diff --git a/core/cmdbchangeop.class.inc.php b/core/cmdbchangeop.class.inc.php index d9021c061..02dbd41f9 100644 --- a/core/cmdbchangeop.class.inc.php +++ b/core/cmdbchangeop.class.inc.php @@ -436,24 +436,19 @@ class CMDBChangeOpSetAttributeBlob extends CMDBChangeOpSetAttribute $oMonoObjectSet = new DBObjectSet($oTargetSearch); if (UserRights::IsActionAllowedOnAttribute($this->Get('objclass'), $this->Get('attcode'), UR_ACTION_READ, $oMonoObjectSet) == UR_ALLOWED_YES) { - if (MetaModel::IsValidAttCode($this->Get('objclass'), $this->Get('attcode'))) - { + if (MetaModel::IsValidAttCode($this->Get('objclass'), $this->Get('attcode'))) { $oAttDef = MetaModel::GetAttributeDef($this->Get('objclass'), $this->Get('attcode')); $sAttName = $oAttDef->GetLabel(); - } - else - { + } else { // The attribute was renamed or removed from the object ? $sAttName = $this->Get('attcode'); } + /** @var \ormDocument $oPrevDoc */ $oPrevDoc = $this->Get('prevdata'); - if ($oPrevDoc->IsEmpty()) - { + if ($oPrevDoc->IsEmpty()) { $sPrevious = ''; $sResult = Dict::Format('Change:AttName_Changed_PreviousValue_OldValue', $sAttName, $sPrevious); - } - else - { + } else { $sFieldAsHtml = $oPrevDoc->GetAsHTML(); $sDisplayLabel = Dict::S('UI:OpenDocumentInNewWindow_'); @@ -463,7 +458,7 @@ class CMDBChangeOpSetAttributeBlob extends CMDBChangeOpSetAttribute $sDownloadUrl = $oPrevDoc->GetDownloadURL(get_class($this), $this->GetKey(), 'prevdata'); $sDocView = << +{$sFieldAsHtml} {$sDisplayLabel} / {$sDownloadLabel} HTML; $sResult = Dict::Format('Change:AttName_Changed_PreviousValue_OldValue', $sAttName, $sDocView); diff --git a/core/ormdocument.class.inc.php b/core/ormdocument.class.inc.php index ed5f16b70..1af6b5c67 100644 --- a/core/ormdocument.class.inc.php +++ b/core/ormdocument.class.inc.php @@ -118,7 +118,8 @@ class ormDocument else { $data = $this->GetData(); - $sResult = htmlentities($this->GetFileName(), ENT_QUOTES, 'UTF-8').' [ '.$this->GetMimeType().', size: '.strlen($data).' byte(s) ]
'; + $sSize = utils::BytesToFriendlyFormat(strlen($data)); + $sResult = htmlentities($this->GetFileName(), ENT_QUOTES, 'UTF-8').' ('.$sSize.')
'; } return $sResult; }