Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Fix search in fusioninventory groupes fields from plugin fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Jan 19, 2020
1 parent 82a89b7 commit 1ba9c3d
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions inc/computer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 1ba9c3d

Please sign in to comment.