diff --git a/src/Computer.php b/src/Computer.php index 1931250c69c..77151890612 100644 --- a/src/Computer.php +++ b/src/Computer.php @@ -613,6 +613,36 @@ public function rawSearchOptions() return $tab; } + public static function rawSearchOptionsToAdd($itemtype) + { + $tab = []; + + $tab[] = [ + 'id' => 'Computer', + 'name' => __('Computers') + ]; + + $tab[] = [ + 'id' => '5', + 'table' => Computer::getTable(), + 'field' => 'uuid', + 'name' => __('Computer UUID'), + 'datatype' => 'string', + 'massiveaction' => false, + 'forcegroupby' => true, + 'joinparams' => [ + 'beforejoin' => [ + 'table' => ComputerVirtualMachine::getTable(), + 'joinparams' => [ + 'jointype' => 'child', + ] + ] + ] + ]; + + return $tab; + } + public static function getIcon() { return "ti ti-device-laptop"; diff --git a/src/ComputerVirtualMachine.php b/src/ComputerVirtualMachine.php index fb79625dc2a..bb1901b8ddd 100644 --- a/src/ComputerVirtualMachine.php +++ b/src/ComputerVirtualMachine.php @@ -493,6 +493,8 @@ public function rawSearchOptions() 'massiveaction' => false, ]; + $tab = array_merge($tab, Computer::rawSearchOptionsToAdd("ComputerVirtualMachine")); + return $tab; }