Correction de la structure du plugin GLPI

This commit is contained in:
tips-of-mine
2025-05-31 11:31:43 +02:00
committed by GitHub
parent fd697b44cc
commit 9b49bc8dff
4 changed files with 37 additions and 81 deletions

View File

@ -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';