@@ -886,17 +886,17 @@ public function compute($start, $params = [])
886886 $ where ['dev.networks_id ' ] = $ this ->fields ["networks_id " ];
887887 }
888888
889+ $ addtype = addslashes ($ type );
889890 $ select = [
890891 'port.id ' ,
891- new QueryExpression ("' " . $ type . "' AS itemtype " ),
892+ new QueryExpression ("' " . $ addtype . "' AS itemtype " ),
892893 'port.items_id ' ,
893894 'dev.name AS dname ' ,
894895 'port.name AS pname ' ,
895- 'glpi_ipaddresses.name AS ip ' ,
896+ 'glpi_ipaddresses.name AS ipaddr ' ,
896897 'port.mac '
897898 ];
898- if ($ type == 'PluginFusioninventoryUnknownDevice '
899- || $ type == 'Enclosure ' || $ type == 'PDU ' || $ type == 'Cluster ' || $ type == 'Unmanaged ' ) {
899+ if ($ type == 'Enclosure ' || $ type == 'PDU ' || $ type == 'Cluster ' || $ type == 'Unmanaged ' ) {
900900 $ select [] = new QueryExpression ("0 AS users_id " );
901901 } else {
902902 $ select [] = 'dev.users_id ' ;
@@ -928,7 +928,7 @@ public function compute($start, $params = [])
928928 ]
929929 ],
930930 'WHERE ' => $ where ,
931- 'GROUPBY ' => ['ip ' , 'port.mac ' ],
931+ 'GROUPBY ' => ['ipaddr ' , 'port.mac ' ],
932932 'ORDER ' => 'ipnum '
933933 ]);
934934 }
@@ -1148,7 +1148,7 @@ public function showReport($params)
11481148 'Manual launch of ping ' ,
11491149 'addressing '
11501150 ) . "'> " ;
1151- echo "<i class='fas fa-spinner ' data-hasqtip='0' aria-hidden='true'></i> " ;
1151+ echo "<i class='ti ti-refresh ' data-hasqtip='0' aria-hidden='true'></i> " ;
11521152 echo _sx ('button ' , 'Manual launch of ping ' , 'addressing ' );
11531153 echo "</button> " ;
11541154 echo "</td> " ;
@@ -1335,12 +1335,14 @@ public static function processMassiveActionsForOneItemtype(
13351335 **/
13361336 public static function getTypes ($ all = false )
13371337 {
1338+ global $ CFG_GLPI ;
1339+
13381340 if ($ all ) {
1339- return self :: $ types ;
1341+ return $ CFG_GLPI [ ' networkport_types ' ] ;
13401342 }
13411343
13421344 // Only allowed types
1343- $ types = self :: $ types ;
1345+ $ types = $ CFG_GLPI [ ' networkport_types ' ] ;
13441346
13451347 foreach ($ types as $ key => $ type ) {
13461348 if (!class_exists ($ type )) {
@@ -1352,6 +1354,7 @@ public static function getTypes($all = false)
13521354 unset($ types [$ key ]);
13531355 }
13541356 }
1357+
13551358 return $ types ;
13561359 }
13571360
@@ -1368,11 +1371,11 @@ public static function dropdownItemtype()
13681371 //Add definition : display dropdown
13691372 $ types = self ::getTypes ();
13701373
1371- // $options[0] = Dropdown::EMPTY_VALUE ;
1374+ $ options = [] ;
13721375
13731376 foreach ($ types as $ itemtype ) {
13741377 $ item = new $ itemtype ();
1375- $ options [$ itemtype ] = $ item ->getTypeName ($ itemtype );
1378+ $ options [$ itemtype ] = $ item ->getTypeName (1 );
13761379 }
13771380
13781381// asort($options);
0 commit comments