mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
Permit to use addDefaultXXX for plugins in search engine see #2547
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@148 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
ca9fae065f
commit
ed351bce69
37
hook.php
37
hook.php
@ -100,6 +100,43 @@ function plugin_example_giveItem($type,$ID,$data,$num) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function plugin_example_addDefaultJoin($type, $ref_table, &$already_link_tables) {
|
||||
|
||||
// Example of default JOIN clause
|
||||
// No need of the function if you do not have specific cases
|
||||
switch ($type) {
|
||||
// case "PluginExampleExample" :
|
||||
case "MyType" :
|
||||
return Search::addLeftJoin($type, $ref_table, $already_link_tables,
|
||||
"newtable", "linkfield");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function plugin_example_addDefaultSelect($type) {
|
||||
|
||||
// Example of default SELECT item to be added
|
||||
// No need of the function if you do not have specific cases
|
||||
switch ($type) {
|
||||
// case "PluginExampleExample" :
|
||||
case "MyType" :
|
||||
return "`mytable`.`myfield` = 'myvalue' AS MYNAME, ";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function plugin_example_addDefaultWhere($type) {
|
||||
|
||||
// Example of default WHERE item to be added
|
||||
// No need of the function if you do not have specific cases
|
||||
switch ($type) {
|
||||
// case "PluginExampleExample" :
|
||||
case "MyType" :
|
||||
return " `mytable`.`myfield` = 'myvalue' ";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
function plugin_example_addLeftJoin($type,$ref_table,$new_table,$linkfield) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user