From 41baa4ce8ff26fe48cd2bea4354f38041dc0ccd1 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 31 May 2025 13:06:20 +0000 Subject: [PATCH] Feat: Add plugin activation and deactivation functions Added the missing `plugin_enable_soc` and `plugin_disable_soc` functions to `setup.php`. These functions are required by GLPI to manage the plugin's lifecycle and display the enable/disable buttons in the plugin management interface. Currently, they simply return true, but can be expanded with specific logic if needed in the future. This change should allow the plugin to be activated from the GLPI UI. --- setup.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/setup.php b/setup.php index 04c84a3..d62fe09 100644 --- a/setup.php +++ b/setup.php @@ -76,7 +76,7 @@ function plugin_init_soc() { // Register plugin classes Plugin::registerClass('PluginSocCase'); - Plugin::registerClass('PluginSocProfile'); + Plugin::registerClass('PluginSocProfile', ['classname' => 'PluginSocProfile']); // Add menu items if (Session::haveRight('plugin_soc_case', READ)) { @@ -209,5 +209,25 @@ function plugin_soc_uninstall() { // Uninstall plugin configuration PluginSocConfig::uninstall(); + return true; +} + +/** + * Plugin activation function + * + * @return boolean + */ +function plugin_enable_soc() { + // Add any specific activation logic here if needed in the future + return true; +} + +/** + * Plugin deactivation function + * + * @return boolean + */ +function plugin_disable_soc() { + // Add any specific deactivation logic here if needed in the future return true; } \ No newline at end of file