Skip to content

Commit

Permalink
Add genericobject items support
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jun 23, 2022
1 parent 33f806b commit e81717f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inc/toolbox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,20 @@ public static function getGlpiItemtypes(): array
__('Other') => $other_itemtypes,
];

$plugin = new Plugin();
if ($plugin->isActivated('genericobject') && method_exists('PluginGenericobjectType', 'getTypes')) {
$go_itemtypes = [];
foreach (array_keys(PluginGenericobjectType::getTypes()) as $go_itemtype) {
if (!class_exists($go_itemtype)) {
continue;
}
$go_itemtypes[] = $go_itemtype;
}
if (count($go_itemtypes) > 0) {
$all_itemtypes[$plugin->getInfo('genericobject', 'name')] = $go_itemtypes;
}
}

$plugins_names = [];
foreach ($all_itemtypes as $section => $itemtypes) {
$named_itemtypes = [];
Expand Down

0 comments on commit e81717f

Please sign in to comment.