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:
moyooo 2010-12-23 09:11:14 +00:00
parent ca9fae065f
commit ed351bce69

View File

@ -100,6 +100,43 @@ function plugin_example_giveItem($type,$ID,$data,$num) {
return ""; 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) { function plugin_example_addLeftJoin($type,$ref_table,$new_table,$linkfield) {