From 07b2fbd88fd0ffd211bb80411d2dc1b48ccfcdd1 Mon Sep 17 00:00:00 2001 From: tsmr Date: Fri, 30 Oct 2009 20:53:29 +0000 Subject: [PATCH] giveitem correction git-svn-id: https://forge.glpi-project.org/svn/example/trunk@99 349b9182-4a13-0410-896f-e5e9767dd1b3 --- hook.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hook.php b/hook.php index 63746a8..54b5ffb 100644 --- a/hook.php +++ b/hook.php @@ -135,10 +135,12 @@ function plugin_example_getAddSearchOptions($itemtype){ } function plugin_example_giveItem($type,$ID,$data,$num){ - global $CFG_GLPI, $INFOFORM_PAGES,$SEARCH_OPTION; + global $CFG_GLPI, $INFOFORM_PAGES; - $table=$SEARCH_OPTION[$type][$ID]["table"]; - $field=$SEARCH_OPTION[$type][$ID]["field"]; + $searchopt=getSearchOptions($type); + + $table=$searchopt[$ID]["table"]; + $field=$searchopt[$ID]["field"]; switch ($table.'.'.$field){ case "glpi_plugin_example.name" :