From 87a36b7e657f6fc85c4597e319b4ceec661d26bf Mon Sep 17 00:00:00 2001 From: moyooo Date: Tue, 6 Jan 2009 21:28:28 +0000 Subject: [PATCH] Update example plugin to #1141 of the core git-svn-id: https://forge.glpi-project.org/svn/example/trunk@61 349b9182-4a13-0410-896f-e5e9767dd1b3 --- hook.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hook.php b/hook.php index 330fc89..b404b5a 100644 --- a/hook.php +++ b/hook.php @@ -89,10 +89,13 @@ function plugin_example_getSearchOption(){ return $sopt; } -function plugin_example_giveItem($type,$field,$data,$num,$linkfield=""){ - global $CFG_GLPI, $INFOFORM_PAGES; +function plugin_example_giveItem($type,$ID,$data,$num){ + global $CFG_GLPI, $INFOFORM_PAGES,$SEARCH_OPTION; - switch ($field){ + $table=$SEARCH_OPTION[$type][$ID]["table"]; + $field=$SEARCH_OPTION[$type][$ID]["field"]; + + switch ($table.'.'.$field){ case "glpi_plugin_example.name" : $out= ""; $out.= $data["ITEM_$num"];