mirror of
https://github.com/tips-of-mine/GLPI-Plugin-SOC-Case-Management.git
synced 2025-06-28 05:38:42 +02:00
Ajouter le fichier hook.php et corriger l'installation
This commit is contained in:
74
hook.php
Normal file
74
hook.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Hook functions for the SOC plugin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Hook called after a new item has been added
|
||||
*
|
||||
* @param CommonDBTM $item
|
||||
* @return void
|
||||
*/
|
||||
function plugin_soc_item_add(CommonDBTM $item) {
|
||||
// Add actions when a new item is created
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook called after an item has been updated
|
||||
*
|
||||
* @param CommonDBTM $item
|
||||
* @return void
|
||||
*/
|
||||
function plugin_soc_item_update(CommonDBTM $item) {
|
||||
// Add actions when an item is updated
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook called after an item has been deleted
|
||||
*
|
||||
* @param CommonDBTM $item
|
||||
* @return void
|
||||
*/
|
||||
function plugin_soc_item_delete(CommonDBTM $item) {
|
||||
// Add actions when an item is deleted
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook called after an item has been purged
|
||||
*
|
||||
* @param CommonDBTM $item
|
||||
* @return void
|
||||
*/
|
||||
function plugin_soc_item_purge(CommonDBTM $item) {
|
||||
// Add actions when an item is purged
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook called when displaying the tabs for an item
|
||||
*
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
function plugin_soc_getAddSearchOptions($itemtype) {
|
||||
$options = [];
|
||||
|
||||
// Add search options for supported item types
|
||||
if ($itemtype == 'Ticket' || $itemtype == 'Change') {
|
||||
$options[9000] = [
|
||||
'table' => 'glpi_plugin_soc_cases',
|
||||
'field' => 'name',
|
||||
'name' => __('SOC Case', 'soc'),
|
||||
'joinparams' => [
|
||||
'beforejoin' => [
|
||||
'table' => $itemtype == 'Ticket' ? 'glpi_plugin_soc_case_tickets' : 'glpi_plugin_soc_case_changes',
|
||||
'joinparams' => [
|
||||
'jointype' => 'itemtype_item',
|
||||
'specific_itemtype' => $itemtype
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
Reference in New Issue
Block a user