mirror of
				https://github.com/pluginsGLPI/example.git
				synced 2025-11-04 05:24:52 +01:00 
			
		
		
		
	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
This commit is contained in:
		
							
								
								
									
										9
									
								
								hook.php
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								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= "<a href=\"".$CFG_GLPI["root_doc"]."/".$INFOFORM_PAGES[$type]."?ID=".$data['ID']."\">";
 | 
			
		||||
			$out.= $data["ITEM_$num"];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user