Skip to content

Commit

Permalink
feat(glpiselectfield): databases plugin support
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Apr 15, 2021
1 parent 9cea337 commit e245ba5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/field/glpiselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
use PassiveDCEquipment;
use PluginAppliancesAppliance;
use Plugin;
use PluginDatabasesDatabase;

use GlpiPlugin\Formcreator\Exception\ComparisonException;

Expand Down Expand Up @@ -116,6 +117,9 @@ public function getDesignSpecializationField(): array {
if ((new Plugin())->isActivated('appliances')) {
$optgroup[__("Assets")][PluginAppliancesAppliance::class] = PluginAppliancesAppliance::getTypeName(2) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
}
if ((new Plugin())->isActivated('databases')) {
$optgroup[__("Assets")][PluginDatabasesDatabase::class] = PluginDatabasesDatabase::getTypeName(2) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
}
array_unshift($optgroup, '---');
$field = Dropdown::showFromArray('glpi_objects', $optgroup, [
'value' => $this->question->fields['values'],
Expand Down

0 comments on commit e245ba5

Please sign in to comment.