Skip to content

Commit

Permalink
feat(glpioblectfield): support for native appliance object
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Nov 19, 2020
1 parent 30c86ae commit 5592f15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/field/glpiselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Ticket;
use Computer;
use Monitor;
use Appliance;
use Software;
use NetworkEquipment;
use Peripheral;
Expand Down Expand Up @@ -108,9 +109,13 @@ public function getDesignSpecializationField() {
// Does not exists in GLPI 9.4
$optgroup['Assets'][PassiveDCEquipment::class] = PassiveDCEquipment::getTypeName(2);
}
if (class_exists(Appliance::class)) {
// Does not exists in GLPI 9.4
$optgroup['Assets'][Appliance::class] = Appliance::getTypeName(2);
}
$plugin = new Plugin();
if ($plugin->isActivated('appliances')) {
$optgroup[__("Assets")][PluginAppliancesAppliance::class] = PluginAppliancesAppliance::getTypeName(2);
$optgroup[__("Assets")][PluginAppliancesAppliance::class] = PluginAppliancesAppliance::getTypeName(2) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
}
array_unshift($optgroup, '---');
$field = Dropdown::showFromArray('glpi_objects', $optgroup, [
Expand Down

0 comments on commit 5592f15

Please sign in to comment.