Skip to content

Commit

Permalink
feat(glpiselectfield): drop compatibility with GLPI 9.4
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Dec 10, 2020
1 parent 7e3c6e7 commit 63abdff
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions inc/field/glpiselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public function getDesignSpecializationField(): array {
CartridgeItem::class => CartridgeItem::getTypeName(2),
ConsumableItem::class => ConsumableItem::getTypeName(2),
Phone::class => Phone::getTypeName(2),
Line::class => Line::getTypeName(2)
Line::class => Line::getTypeName(2),
PassiveDCEquipment::class => PassiveDCEquipment::getTypeName(2),
Appliance::class => Appliance::getTypeName(2),
],
__("Assistance") => [
Ticket::class => Ticket::getTypeName(2),
Expand All @@ -111,16 +113,7 @@ public function getDesignSpecializationField(): array {
Profile::class => Profile::getTypeName(2)
],
];
if (class_exists(PassiveDCEquipment::class)) {
// 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')) {
if ((new Plugin())->isActivated('appliances')) {
$optgroup[__("Assets")][PluginAppliancesAppliance::class] = PluginAppliancesAppliance::getTypeName(2) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
}
array_unshift($optgroup, '---');
Expand Down

0 comments on commit 63abdff

Please sign in to comment.