mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-06-28 06:58:43 +02:00
first work on Search class
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@111 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
12
hook.php
12
hook.php
@ -90,12 +90,12 @@ function plugin_example_getAddSearchOptions($itemtype){
|
||||
function plugin_example_giveItem($type,$ID,$data,$num){
|
||||
global $CFG_GLPI, $INFOFORM_PAGES;
|
||||
|
||||
$searchopt=&getSearchOptions($type);
|
||||
$searchopt=&Search::getOptions($type);
|
||||
$table=$searchopt[$ID]["table"];
|
||||
$field=$searchopt[$ID]["field"];
|
||||
|
||||
switch ($table.'.'.$field){
|
||||
case "glpi_plugin_example.name" :
|
||||
case "glpi_plugin_example_example.name" :
|
||||
$out= "<a href=\"".$CFG_GLPI["root_doc"]."/".$INFOFORM_PAGES[$type]."?id=".$data['id']."\">";
|
||||
$out.= $data["ITEM_$num"];
|
||||
if ($_SESSION["glpiis_ids_visible"]||empty($data["ITEM_$num"])) $out.= " (".$data["id"].")";
|
||||
@ -132,7 +132,7 @@ function plugin_example_forceGroupBy($type){
|
||||
|
||||
function plugin_example_addWhere($link,$nott,$type,$ID,$val){
|
||||
|
||||
$searchopt=&getSearchOptions($type);
|
||||
$searchopt=&Search::getOptions($type);
|
||||
$table=$searchopt[$ID]["table"];
|
||||
$field=$searchopt[$ID]["field"];
|
||||
|
||||
@ -155,7 +155,7 @@ function plugin_example_addWhere($link,$nott,$type,$ID,$val){
|
||||
// This is not a real example because the use of Having condition in this case is not suitable
|
||||
function plugin_example_addHaving($link,$nott,$type,$ID,$val,$num){
|
||||
|
||||
$searchopt=&getSearchOptions($type);
|
||||
$searchopt=&Search::getOptions($type);
|
||||
$table=$searchopt[$ID]["table"];
|
||||
$field=$searchopt[$ID]["field"];
|
||||
|
||||
@ -180,7 +180,7 @@ function plugin_example_addHaving($link,$nott,$type,$ID,$val,$num){
|
||||
|
||||
function plugin_example_addSelect($type,$ID,$num){
|
||||
|
||||
$searchopt=&getSearchOptions($type);
|
||||
$searchopt=&Search::getOptions($type);
|
||||
$table=$searchopt[$ID]["table"];
|
||||
$field=$searchopt[$ID]["field"];
|
||||
|
||||
@ -196,7 +196,7 @@ function plugin_example_addSelect($type,$ID,$num){
|
||||
|
||||
function plugin_example_addOrderBy($type,$ID,$order,$key=0){
|
||||
|
||||
$searchopt=&getSearchOptions($type);
|
||||
$searchopt=&Search::getOptions($type);
|
||||
$table=$searchopt[$ID]["table"];
|
||||
$field=$searchopt[$ID]["field"];
|
||||
|
||||
|
Reference in New Issue
Block a user