Skip to content

Commit

Permalink
add SO Computer in ComputerVirtualMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
MyvTsv authored and cedric-anne committed Nov 4, 2024
1 parent a9c2464 commit 1e9aa17
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Computer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions src/ComputerVirtualMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ public function rawSearchOptions()
'massiveaction' => false,
];

$tab = array_merge($tab, Computer::rawSearchOptionsToAdd("ComputerVirtualMachine"));

return $tab;
}

Expand Down

0 comments on commit 1e9aa17

Please sign in to comment.