mirror of
https://github.com/tips-of-mine/GLPI-Plugin-SOC-Case-Management.git
synced 2025-06-28 05:38:42 +02:00
Correction du fichier hook.php pour le plugin SOC
This commit is contained in:
32
setup.php
32
setup.php
@ -65,35 +65,51 @@ function plugin_init_soc() {
|
||||
global $PLUGIN_HOOKS;
|
||||
|
||||
$PLUGIN_HOOKS['csrf_compliant']['soc'] = true;
|
||||
$PLUGIN_HOOKS['menu_toadd']['soc'] = ['management' => 'PluginSocCase'];
|
||||
|
||||
// Add JavaScript and CSS
|
||||
$PLUGIN_HOOKS['javascript']['soc'] = ['plugins/soc/js/soc.js'];
|
||||
$PLUGIN_HOOKS['add_css']['soc'] = ['plugins/soc/css/soc.css'];
|
||||
|
||||
// Initialize translations
|
||||
include_once(GLPI_ROOT . '/plugins/soc/inc/plugin_init_translations.php');
|
||||
$PLUGIN_HOOKS['init_translations']['soc'] = 'plugin_init_soc_translations';
|
||||
|
||||
// Register plugin classes
|
||||
Plugin::registerClass('PluginSocCase');
|
||||
|
||||
Plugin::registerClass('PluginSocProfile', ['addtabtypes' => ['Profile']]);
|
||||
|
||||
// Add menu items
|
||||
if (Session::haveRight('plugin_soc_case', READ)) {
|
||||
$PLUGIN_HOOKS['menu_toadd']['soc'] = ['management' => 'PluginSocCase'];
|
||||
}
|
||||
|
||||
// Add a tab to Changes
|
||||
if (Session::haveRight('change', READ)) {
|
||||
Plugin::registerClass('PluginSocCase', [
|
||||
'addtabtypes' => ['Change']
|
||||
]);
|
||||
$PLUGIN_HOOKS['add_tab']['soc'] = [
|
||||
'Change' => 'PluginSocCase',
|
||||
];
|
||||
}
|
||||
|
||||
// Add a tab to Tickets
|
||||
if (Session::haveRight('ticket', READ)) {
|
||||
Plugin::registerClass('PluginSocCase', [
|
||||
'addtabtypes' => ['Ticket']
|
||||
]);
|
||||
$PLUGIN_HOOKS['add_tab']['soc'] = [
|
||||
'Ticket' => 'PluginSocCase',
|
||||
];
|
||||
}
|
||||
|
||||
// Add config page
|
||||
if (Session::haveRight('config', UPDATE)) {
|
||||
$PLUGIN_HOOKS['config_page']['soc'] = 'front/config.form.php';
|
||||
}
|
||||
|
||||
// Hook for item actions
|
||||
$PLUGIN_HOOKS['item_add']['soc'] = ['*' => 'plugin_soc_item_add'];
|
||||
$PLUGIN_HOOKS['item_update']['soc'] = ['*' => 'plugin_soc_item_update'];
|
||||
$PLUGIN_HOOKS['item_delete']['soc'] = ['*' => 'plugin_soc_item_delete'];
|
||||
$PLUGIN_HOOKS['item_purge']['soc'] = ['*' => 'plugin_soc_item_purge'];
|
||||
|
||||
// Display hooks
|
||||
$PLUGIN_HOOKS['post_item_form']['soc'] = ['PluginSocCase', 'displayTabContentForItem'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user