From b593beb8c748dee2327ac3ffcbb8bc8ff05d0a0a Mon Sep 17 00:00:00 2001 From: Thomas Casteleyn Date: Tue, 10 Jan 2023 18:53:00 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B05867=20Display=20binary=20data=20size=20?= =?UTF-8?q?in=20SynchroReplica=20details=20(#286)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- synchro/synchrodatasource.class.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/synchro/synchrodatasource.class.inc.php b/synchro/synchrodatasource.class.inc.php index eb9d32b2c..d02dfd777 100644 --- a/synchro/synchrodatasource.class.inc.php +++ b/synchro/synchrodatasource.class.inc.php @@ -2818,12 +2818,16 @@ class SynchroReplica extends DBObject implements iDisplay $aData = $this->LoadExtendedDataFromTable($sSQLTable); $aHeaders = array( - 'attcode' => array('label' => 'Attribute Code', 'description' => ''), - 'data' => array('label' => 'Value', 'description' => ''), + 'attcode' => array('label' => Dict::S('UI:Form:Property'), 'description' => ''), + 'data' => array('label' => Dict::S('UI:Form:Value'), 'description' => ''), ); $aRows = array(); foreach ($aData as $sKey => $value) { - $aRows[] = array('attcode' => $sKey, 'data' => $value); + if (strpos(CMDBSource::GetFieldType($sSQLTable, $sKey), 'blob') !== false) { + $aRows[] = array('attcode' => $sKey, 'data' => sprintf('%s (%s)', Dict::S('Core:AttributeBlob'), utils::BytesToFriendlyFormat(strlen($value)))); + } else { + $aRows[] = array('attcode' => $sKey, 'data' => utils::EscapeHtml($value)); + } } $oPage->Table($aHeaders, $aRows); $oPage->add('');