N°9137 - Add a logo for each Network Device Type

This commit is contained in:
v-dumas
2026-03-24 16:57:49 +01:00
parent a4a0b3c18c
commit a382a66f63
18 changed files with 78 additions and 2 deletions

View File

@@ -1283,7 +1283,39 @@
</items> </items>
</summary> </summary>
</presentation> </presentation>
<methods/> <methods>
<method id="GetIcon">
<comment> /**
* Overrides the GetIcon method to return the logo of the associated NetworkDeviceType if any, otherwise the default icon of the class will be returned
*
*/</comment>
<static>false</static>
<access>public</access>
<type>Custom</type>
<code><![CDATA[ public function GetIcon($bImgTag = true)
{
$sIconClass = 'NetworkDeviceType'; // the class storing the image which will be used as icon for the current object
$sExtKeyCode = 'networkdevicetype_id'; // the external key attribute code pointing to the class storing the image attribute
$sIconAttCode = 'logo'; // the attribute code of the image in the IconClass
$iObj = $this->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 "<img src=\"$sIconUrl\" alt=''/>";
} else {
return $sIconUrl;
}
}
}
// Return the default image
return parent::GetIcon($bImgTag);
}]]></code>
</method>
</methods>
<relations> <relations>
<relation id="impacts"> <relation id="impacts">
<neighbours> <neighbours>
@@ -5313,6 +5345,13 @@
</reconciliation> </reconciliation>
</properties> </properties>
<fields> <fields>
<field id="logo" xsi:type="AttributeImage">
<display_max_width>96</display_max_width>
<display_max_height>96</display_max_height>
<storage_max_width>128</storage_max_width>
<storage_max_height>128</storage_max_height>
<is_null_allowed>true</is_null_allowed>
</field>
<field id="networkdevicesdevices_list" xsi:type="AttributeLinkedSet"> <field id="networkdevicesdevices_list" xsi:type="AttributeLinkedSet">
<linked_class>NetworkDevice</linked_class> <linked_class>NetworkDevice</linked_class>
<ext_key_to_me>networkdevicetype_id</ext_key_to_me> <ext_key_to_me>networkdevicetype_id</ext_key_to_me>
@@ -5329,6 +5368,9 @@
<item id="name"> <item id="name">
<rank>10</rank> <rank>10</rank>
</item> </item>
<item id="logo">
<rank>20</rank>
</item>
<item id="networkdevicesdevices_list"> <item id="networkdevicesdevices_list">
<rank>20</rank> <rank>20</rank>
</item> </item>
@@ -5343,7 +5385,7 @@
</search> </search>
<list> <list>
<items> <items>
<item id="name"> <item id="logo">
<rank>10</rank> <rank>10</rank>
</item> </item>
</items> </items>

View File

@@ -1160,6 +1160,8 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', [
Dict::Add('CS CZ', 'Czech', 'Čeština', [ Dict::Add('CS CZ', 'Czech', 'Čeština', [
'Class:NetworkDeviceType' => 'Typ síťového zařízení', 'Class:NetworkDeviceType' => 'Typ síťového zařízení',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Síťová zařízení', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Síťová zařízení',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Všechna síťová zařízení odpovídající tomuto typu', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Všechna síťová zařízení odpovídající tomuto typu',
]); ]);

View File

@@ -1159,6 +1159,8 @@ Dict::Add('DA DA', 'Danish', 'Dansk', [
Dict::Add('DA DA', 'Danish', 'Dansk', [ Dict::Add('DA DA', 'Danish', 'Dansk', [
'Class:NetworkDeviceType' => 'Netværksenhed type', 'Class:NetworkDeviceType' => 'Netværksenhed type',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Netværks enheder', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Netværks enheder',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type~~', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type~~',
]); ]);

View File

@@ -1159,6 +1159,8 @@ Dict::Add('DE DE', 'German', 'Deutsch', [
Dict::Add('DE DE', 'German', 'Deutsch', [ Dict::Add('DE DE', 'German', 'Deutsch', [
'Class:NetworkDeviceType' => 'Netzwerkgerätetyp', 'Class:NetworkDeviceType' => 'Netzwerkgerätetyp',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Netzwerkgeräte', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Netzwerkgeräte',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Alle Netzwerkgeräte, die diesem Typ entsprechen', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Alle Netzwerkgeräte, die diesem Typ entsprechen',
]); ]);

View File

@@ -1167,6 +1167,8 @@ Dict::Add('EN US', 'English', 'English', [
Dict::Add('EN US', 'English', 'English', [ Dict::Add('EN US', 'English', 'English', [
'Class:NetworkDeviceType' => 'Network Device Type', 'Class:NetworkDeviceType' => 'Network Device Type',
'Class:NetworkDeviceType+' => 'Typology. The possible values for the "Type" of a Network Device (e.g. Router, Switch, Firewall, etc.).', 'Class:NetworkDeviceType+' => 'Typology. The possible values for the "Type" of a Network Device (e.g. Router, Switch, Firewall, etc.).',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Network devices', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Network devices',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type',
]); ]);

View File

@@ -1158,6 +1158,8 @@ Dict::Add('EN GB', 'British English', 'British English', [
Dict::Add('EN GB', 'British English', 'British English', [ Dict::Add('EN GB', 'British English', 'British English', [
'Class:NetworkDeviceType' => 'Network Device Type', 'Class:NetworkDeviceType' => 'Network Device Type',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Network devices', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Network devices',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type',
]); ]);

View File

@@ -1156,6 +1156,8 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
'Class:NetworkDeviceType' => 'Tipo Dispositivo de Red', 'Class:NetworkDeviceType' => 'Tipo Dispositivo de Red',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Dispositivos de Red', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Dispositivos de Red',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Dispositivos de Red', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Dispositivos de Red',
]); ]);

View File

@@ -1312,6 +1312,8 @@ Dict::Add('FR FR', 'French', 'Français', [
Dict::Add('FR FR', 'French', 'Français', [ Dict::Add('FR FR', 'French', 'Français', [
'Class:NetworkDeviceType' => 'Type d\'équipement réseau', 'Class:NetworkDeviceType' => 'Type d\'équipement réseau',
'Class:NetworkDeviceType+' => 'Typologie. Valeurs possibles pour le type dun équipement réseau (ex : Routeur, Switch, Firewall, etc.).', 'Class:NetworkDeviceType+' => 'Typologie. Valeurs possibles pour le type dun équipement réseau (ex : Routeur, Switch, Firewall, etc.).',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo',
'Class:NetworkDeviceType/Attribute:logo+' => 'Utilisé comme icône pour les équipement réseau de ce Type lors de leur affichage (détails, aperçu et graphe d\'analyse d\'impact)',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Equipements réseaux', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Equipements réseaux',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Tous les équipements réseaux correspondant à ce type', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Tous les équipements réseaux correspondant à ce type',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list/UI:Links:Create:Button+' => 'Créer un %4$s', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list/UI:Links:Create:Button+' => 'Créer un %4$s',

View File

@@ -1158,6 +1158,8 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [
Dict::Add('HU HU', 'Hungarian', 'Magyar', [ Dict::Add('HU HU', 'Hungarian', 'Magyar', [
'Class:NetworkDeviceType' => 'Hálózati eszköz típus', 'Class:NetworkDeviceType' => 'Hálózati eszköz típus',
'Class:NetworkDeviceType+' => '~~', 'Class:NetworkDeviceType+' => '~~',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Hálózati eszközök', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Hálózati eszközök',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Ilyen típusú hálózati eszközök', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Ilyen típusú hálózati eszközök',
]); ]);

View File

@@ -1179,6 +1179,8 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [
Dict::Add('IT IT', 'Italian', 'Italiano', [ Dict::Add('IT IT', 'Italian', 'Italiano', [
'Class:NetworkDeviceType' => 'Tipo di Dispositivo di Rete', 'Class:NetworkDeviceType' => 'Tipo di Dispositivo di Rete',
'Class:NetworkDeviceType+' => '~~', 'Class:NetworkDeviceType+' => '~~',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Dispositivi di Rete', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Dispositivi di Rete',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Tutti i dispositivi di rete corrispondenti a questo tipo', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Tutti i dispositivi di rete corrispondenti a questo tipo',
]); ]);

View File

@@ -1158,6 +1158,8 @@ Dict::Add('JA JP', 'Japanese', '日本語', [
Dict::Add('JA JP', 'Japanese', '日本語', [ Dict::Add('JA JP', 'Japanese', '日本語', [
'Class:NetworkDeviceType' => 'ネットワークデバイスタイプ', 'Class:NetworkDeviceType' => 'ネットワークデバイスタイプ',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'ネットワークデバイス', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'ネットワークデバイス',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type~~', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type~~',
]); ]);

View File

@@ -1160,6 +1160,8 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', [
Dict::Add('NL NL', 'Dutch', 'Nederlands', [ Dict::Add('NL NL', 'Dutch', 'Nederlands', [
'Class:NetworkDeviceType' => 'Soort netwerkapparaat', 'Class:NetworkDeviceType' => 'Soort netwerkapparaat',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Netwerkapparaten', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Netwerkapparaten',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Alle netwerkapparaten van deze soort', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Alle netwerkapparaten van deze soort',
]); ]);

View File

@@ -1158,6 +1158,8 @@ Dict::Add('PL PL', 'Polish', 'Polski', [
Dict::Add('PL PL', 'Polish', 'Polski', [ Dict::Add('PL PL', 'Polish', 'Polski', [
'Class:NetworkDeviceType' => 'Typ urządzenia sieciowego', 'Class:NetworkDeviceType' => 'Typ urządzenia sieciowego',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Urządzenia sieciowe', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Urządzenia sieciowe',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Wszystkie urządzenia sieciowe odpowiadające temu typowi', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Wszystkie urządzenia sieciowe odpowiadające temu typowi',
]); ]);

View File

@@ -1158,6 +1158,8 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
Dict::Add('PT BR', 'Brazilian', 'Brazilian', [ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
'Class:NetworkDeviceType' => 'Tipo de dispositivo de rede', 'Class:NetworkDeviceType' => 'Tipo de dispositivo de rede',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Dispositivos de rede', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Dispositivos de rede',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Todos os Dispositivos de rede correspondentes a este Tipo', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Todos os Dispositivos de rede correspondentes a este Tipo',
]); ]);

View File

@@ -1159,6 +1159,8 @@ Dict::Add('RU RU', 'Russian', 'Русский', [
Dict::Add('RU RU', 'Russian', 'Русский', [ Dict::Add('RU RU', 'Russian', 'Русский', [
'Class:NetworkDeviceType' => 'Тип сетевого устройства', 'Class:NetworkDeviceType' => 'Тип сетевого устройства',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Устройства', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Устройства',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Все сетевые устройства этого типа', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Все сетевые устройства этого типа',
]); ]);

View File

@@ -1158,6 +1158,8 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [
Dict::Add('SK SK', 'Slovak', 'Slovenčina', [ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [
'Class:NetworkDeviceType' => 'Typ sieťového zariadenia', 'Class:NetworkDeviceType' => 'Typ sieťového zariadenia',
'Class:NetworkDeviceType+' => '~~', 'Class:NetworkDeviceType+' => '~~',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Sieťové zariadenia', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Sieťové zariadenia',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type~~', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'All the network devices corresponding to this type~~',
]); ]);

View File

@@ -1159,6 +1159,8 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', [
Dict::Add('TR TR', 'Turkish', 'Türkçe', [ Dict::Add('TR TR', 'Turkish', 'Türkçe', [
'Class:NetworkDeviceType' => 'Ağ Cihazı Tipi', 'Class:NetworkDeviceType' => 'Ağ Cihazı Tipi',
'Class:NetworkDeviceType+' => '~~', 'Class:NetworkDeviceType+' => '~~',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Ağ Aygıtları', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => 'Ağ Aygıtları',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Bu türde karşılık gelen tüm ağ aygıtları', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => 'Bu türde karşılık gelen tüm ağ aygıtları',
]); ]);

View File

@@ -1175,6 +1175,8 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', [
Dict::Add('ZH CN', 'Chinese', '简体中文', [ Dict::Add('ZH CN', 'Chinese', '简体中文', [
'Class:NetworkDeviceType' => '网络设备类型', 'Class:NetworkDeviceType' => '网络设备类型',
'Class:NetworkDeviceType+' => '', 'Class:NetworkDeviceType+' => '',
'Class:NetworkDeviceType/Attribute:logo' => 'Logo~~',
'Class:NetworkDeviceType/Attribute:logo+' => 'Used as icon for all Network Device of this type, when displayed in console (details, summary card and impact analysis graphs)~~',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => '网络设备', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list' => '网络设备',
'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => '此类型的所有网络设备', 'Class:NetworkDeviceType/Attribute:networkdevicesdevices_list+' => '此类型的所有网络设备',
]); ]);