mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
add 'item_get_events' hook for plugins which need to add event to core type
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@137 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
02f35718e2
commit
c56d206aa5
4
hook.php
4
hook.php
@ -684,4 +684,8 @@ function plugin_example_AssignToTicket($types) {
|
|||||||
return $types;
|
return $types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function plugin_example_add_event(NotificationTargetTicket $target) {
|
||||||
|
$target->events['plugin_example'] = "Example event";
|
||||||
|
logDebug("plugin_example_add_event",$target->events);
|
||||||
|
}
|
||||||
?>
|
?>
|
@ -104,6 +104,9 @@ function plugin_init_example() {
|
|||||||
'Phone'=>'plugin_pre_item_restore_example2');
|
'Phone'=>'plugin_pre_item_restore_example2');
|
||||||
$PLUGIN_HOOKS['item_restore']['example'] = array('Computer'=>'plugin_item_restore_example');
|
$PLUGIN_HOOKS['item_restore']['example'] = array('Computer'=>'plugin_item_restore_example');
|
||||||
|
|
||||||
|
// Add event to GLPI core itemtype, event will be raised by the plugin.
|
||||||
|
$PLUGIN_HOOKS['item_get_events']['example'] = array('NotificationTargetTicket'=>'plugin_example_add_event');
|
||||||
|
|
||||||
$PLUGIN_HOOKS['item_transfer']['example'] = 'plugin_item_transfer_example';
|
$PLUGIN_HOOKS['item_transfer']['example'] = 'plugin_item_transfer_example';
|
||||||
|
|
||||||
//redirect appel http://localhost/glpi/index.php?redirect=plugin_example_2 (ID 2 du form)
|
//redirect appel http://localhost/glpi/index.php?redirect=plugin_example_2 (ID 2 du form)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user