diff --git a/setup.php b/setup.php index c6b4408..6d3c216 100644 --- a/setup.php +++ b/setup.php @@ -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']; - $PLUGIN_HOOKS[Hooks::PRE_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'preSection']; - $PLUGIN_HOOKS[Hooks::POST_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'postSection']; + //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,8 +290,11 @@ function plugin_init_example() { ComputerModelFilter::class ]; - // Icon in the impact analysis - $PLUGIN_HOOKS[Hooks::SET_ITEM_IMPACT_ICON]['example'] = 'plugin_example_set_impact_icon'; + //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'; + } }