mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 10:04:53 +02:00
Fix(core): check GLPI version before call hook not released yet
closes #85
This commit is contained in:
parent
5a54ffe7b3
commit
1be089786f
@ -260,8 +260,11 @@ function plugin_init_example() {
|
||||
$PLUGIN_HOOKS[Hooks::PRE_ITEM_FORM]['example'] = [ItemForm::class, 'preItemForm'];
|
||||
$PLUGIN_HOOKS[Hooks::POST_ITEM_FORM]['example'] = [ItemForm::class, 'postItemForm'];
|
||||
|
||||
//TODO: remove check when GLPI 11.0.0 is released
|
||||
if (version_compare(GLPI_VERSION, '11.0.0', 'ge')) {
|
||||
$PLUGIN_HOOKS[Hooks::PRE_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'preSection'];
|
||||
$PLUGIN_HOOKS[Hooks::POST_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'postSection'];
|
||||
}
|
||||
|
||||
// Add new actions to timeline
|
||||
$PLUGIN_HOOKS[Hooks::TIMELINE_ACTIONS]['example'] = [
|
||||
@ -287,9 +290,12 @@ function plugin_init_example() {
|
||||
ComputerModelFilter::class
|
||||
];
|
||||
|
||||
//TODO: remove check when GLPI 11.0.0 is released
|
||||
if (version_compare(GLPI_VERSION, '11.0.0', 'ge')) {
|
||||
// Icon in the impact analysis
|
||||
$PLUGIN_HOOKS[Hooks::SET_ITEM_IMPACT_ICON]['example'] = 'plugin_example_set_impact_icon';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user