From e00f0e22b8d6c676c03f7157f1a765e0a2f83a77 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 31 Aug 2017 08:13:04 +0200 Subject: [PATCH] Add getAddSearchOptionsNew example call --- hook.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hook.php b/hook.php index bbc196d..2ee5f8e 100644 --- a/hook.php +++ b/hook.php @@ -77,6 +77,21 @@ function plugin_example_getAddSearchOptions($itemtype) { return $sopt; } +function plugin_example_getAddSearchOptionsNew($itemtype) { + $options = []; + if ($itemtype == 'Computer') { + //Just for example, not working + $options[] = [ + 'id' => '1002', + 'table' => 'glpi_plugin_example_dropdowns', + 'field' => 'name', + 'linkfield' => 'plugin_example_dropdowns_id', + 'name' => __('Example plugin new', 'example') + ]; + } + return $options; +} + // See also PluginExampleExample::getSpecificValueToDisplay() function plugin_example_giveItem($type,$ID,$data,$num) { $searchopt = &Search::getOptions($type);