diff --git a/SOC-Case-Management.xml b/SOC-Case-Management.xml
deleted file mode 100644
index c525b53..0000000
--- a/SOC-Case-Management.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
" . __('Plugin is installed and active.', 'soc') . "
"; +echo "" . __('Go to SOC Dashboard', 'soc') . ""; +echo ""; + +Html::footer(); \ No newline at end of file diff --git a/plugin.php b/plugin.php index 677abd2..2cf0ec9 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ * @version 1.0.0 * @license GPL-3.0+ * @brief GLPI SOC Case Management Plugin - * @copyright 2025 Your Organization + * @copyright 2025 Tips-Of-Mine */ define('PLUGIN_SOC_VERSION', '1.0.0'); @@ -19,9 +19,9 @@ function plugin_version_soc() { return [ 'name' => 'SOC Case Management', 'version' => PLUGIN_SOC_VERSION, - 'author' => 'Your Organization', + 'author' => 'Tips-Of-Mine', 'license' => 'GPL-3.0+', - 'homepage' => 'https://yourorganization.com', + 'homepage' => 'https://github.com/tips-of-mine/GLPI-Plugin-SOC-Case-Management/', 'requirements' => [ 'glpi' => [ 'min' => PLUGIN_SOC_MIN_GLPI, @@ -69,9 +69,9 @@ function plugin_init_soc() { $PLUGIN_HOOKS['menu_toadd']['soc'] = ['management' => 'PluginSocCase']; $PLUGIN_HOOKS['javascript']['soc'] = ['/plugins/soc/js/soc.js']; $PLUGIN_HOOKS['add_css']['soc'] = ['/plugins/soc/css/soc.css']; - + // Initialize translations - $PLUGIN_HOOKS['init_translations']['soc'] = 'initTranslations'; + $PLUGIN_HOOKS['init_translations']['soc'] = 'plugin_init_soc_translations'; if (Session::haveRight('plugin_soc_case', READ)) { $PLUGIN_HOOKS['menu_toadd']['soc'] = ['management' => 'PluginSocCase']; @@ -90,6 +90,11 @@ function plugin_init_soc() { 'addtabtypes' => ['Ticket'] ]); } + + // Add config page + if (Session::haveRight('config', UPDATE)) { + $PLUGIN_HOOKS['config_page']['soc'] = 'front/config.form.php'; + } } /** @@ -97,7 +102,7 @@ function plugin_init_soc() { * * @return void */ -function initTranslations() { +function plugin_init_soc_translations() { global $CFG_GLPI; $domain = 'soc'; diff --git a/setup.php b/setup.php index c3c6e29..c0adf7d 100644 --- a/setup.php +++ b/setup.php @@ -63,6 +63,9 @@ function plugin_soc_install() { // Create profiles rights PluginSocProfile::initProfile(); PluginSocProfile::createFirstAccess($_SESSION['glpiactiveprofile']['id']); + + // Initialize plugin configuration + PluginSocConfig::install(); return true; } @@ -95,19 +98,13 @@ function plugin_soc_uninstall() { // Delete plugin display preferences $query = "DELETE FROM `glpi_displaypreferences` WHERE `itemtype` LIKE 'PluginSoc%'"; $DB->query($query) or die("Error deleting plugin_soc display preferences"); + + // Uninstall plugin configuration + PluginSocConfig::uninstall(); return true; } -/** - * Define hooks - */ -function plugin_init_soc() { - global $PLUGIN_HOOKS; - - // Add plugin hooks here -} - /** * Define database relations */