mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
Fix(core): check GLPI version before call hook not released yet
closes #85
This commit is contained in:
parent
5a54ffe7b3
commit
1be089786f
14
setup.php
14
setup.php
@ -260,8 +260,11 @@ function plugin_init_example() {
|
|||||||
$PLUGIN_HOOKS[Hooks::PRE_ITEM_FORM]['example'] = [ItemForm::class, 'preItemForm'];
|
$PLUGIN_HOOKS[Hooks::PRE_ITEM_FORM]['example'] = [ItemForm::class, 'preItemForm'];
|
||||||
$PLUGIN_HOOKS[Hooks::POST_ITEM_FORM]['example'] = [ItemForm::class, 'postItemForm'];
|
$PLUGIN_HOOKS[Hooks::POST_ITEM_FORM]['example'] = [ItemForm::class, 'postItemForm'];
|
||||||
|
|
||||||
$PLUGIN_HOOKS[Hooks::PRE_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'preSection'];
|
//TODO: remove check when GLPI 11.0.0 is released
|
||||||
$PLUGIN_HOOKS[Hooks::POST_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'postSection'];
|
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
|
// Add new actions to timeline
|
||||||
$PLUGIN_HOOKS[Hooks::TIMELINE_ACTIONS]['example'] = [
|
$PLUGIN_HOOKS[Hooks::TIMELINE_ACTIONS]['example'] = [
|
||||||
@ -287,8 +290,11 @@ function plugin_init_example() {
|
|||||||
ComputerModelFilter::class
|
ComputerModelFilter::class
|
||||||
];
|
];
|
||||||
|
|
||||||
// Icon in the impact analysis
|
//TODO: remove check when GLPI 11.0.0 is released
|
||||||
$PLUGIN_HOOKS[Hooks::SET_ITEM_IMPACT_ICON]['example'] = 'plugin_example_set_impact_icon';
|
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