From 7aaf3da4d50d86bb4b9c836a52b63a6f3993699d Mon Sep 17 00:00:00 2001 From: v-dumas Date: Fri, 13 Mar 2026 15:40:42 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B09347=20-=20Get=20Software=20logo=20as=20?= =?UTF-8?q?SoftwareInstance=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datamodel.itop-config-mgmt.xml | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml b/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml index e1b56c1ec7..11abfc6de3 100755 --- a/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml +++ b/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml @@ -2210,7 +2210,40 @@ - + + + /** + * Overrides the GetIcon method to return the logo of the associated Software if any, otherwise the default icon of the class will be returned + * + */ + false + public + Custom + Get($sExtKeyCode); + if ($iObj > 0) { + $oObj = MetaModel::GetObject($sIconClass, $iObj, true, true); + $oImage = $oObj->Get($sIconAttCode); + $sIconUrl = $oImage->IsEmpty() ? '' : $oImage->GetDisplayURL($sIconClass, $iObj, $sIconAttCode); + if (strlen($sIconUrl) > 0) { + if ($bImgTag) { + return ""; + } else { + return $sIconUrl; + } + } + } + // Return the default image + return parent::GetIcon($bImgTag); + }]]> + + SoftwareInstance