diff --git a/CHANGELOG.md b/CHANGELOG.md index db96851..563ba56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Added + +- Add injection of the ```Itemtype```, ```Item``` and ```Path``` for the database instance + ### Fixed - Fix default entity insertion for a user diff --git a/inc/databaseinstanceinjection.class.php b/inc/databaseinstanceinjection.class.php index 878c28c..ac883c3 100644 --- a/inc/databaseinstanceinjection.class.php +++ b/inc/databaseinstanceinjection.class.php @@ -53,7 +53,7 @@ public function isPrimaryType() public function connectedTo() { - return []; + return [\Glpi\Inventory\Asset\Computer::class]; } @@ -64,11 +64,13 @@ public function getOptions($primary_type = '') { $tab = Search::getOptions(get_parent_class($this)); + $tab[5]['linkfield'] = 'items_id'; // 5 = databaseinstance items_id Search option //Remove some options because some fields cannot be imported $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this)); $notimportable = []; $options['ignore_fields'] = array_merge($blacklist, $notimportable); + $options['displaytype'] = ["dropdown" => [40]]; return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);