From 1ba9c3da0c87e349537baeed9213c459fb8cee36 Mon Sep 17 00:00:00 2001 From: David Durieux Date: Sat, 18 Jan 2020 18:52:36 +0100 Subject: [PATCH] Fix search in fusioninventory groupes fields from plugin fields --- inc/computer.class.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/inc/computer.class.php b/inc/computer.class.php index e7aca4b3ea..6b11259ad8 100644 --- a/inc/computer.class.php +++ b/inc/computer.class.php @@ -60,32 +60,29 @@ class PluginFusioninventoryComputer extends Computer { */ static $rightname = "plugin_fusioninventory_group"; - - /** - * Get search function for the class - * - * @return array - */ - function getSearchOptionsNew() { - // Start with the base Glpi computer items + function rawSearchOptions() { $computer = new Computer(); - $options = $computer->getSearchOptionsNew(); + $options = $computer->rawSearchOptions(); $plugin = new Plugin(); if ($plugin->isInstalled('fields')) { if ($plugin->isActivated('fields')) { - $tab += [ + include_once(GLPI_ROOT . "/plugins/fields/hook.php"); + $options['fields_plugin'] = [ 'id' => 'fields_plugin', 'name' => __('Plugin fields') ]; - $options += PluginFieldsContainer::getAddSearchOptions('Computer'); + $fieldsoptions = plugin_fields_getAddSearchOptions('Computer'); + foreach ($fieldsoptions as $id=>$data) { + $data['id'] = $id; + $options[$id] = $data; + } } } return $options; } - /** * Get the massive actions for this object *